Skip to main content
May 22, 2018 7:58 AM UTC
Solved

Delete components in jlink

Hello

I need to delete some components in an assembly with jlink. I noticed the method Model.Delete() but when i use it nothing seems to be deleted.

I havent seen any examples with this method call.

 

Thank you

Regards  

sjurajAnswer
Oct 10, 2018 5:27 AM UTC

Model.Delete() cause to remove model from session and disk. To remove model from assembly you need to consider the model as feature (ComponentFeat). You then need to perform component operation on this feature. To remove feature you need to create delete ops and then executre the ops. 

 

pfcSolid.Solid.ExecuteFeatureOps

pfcFeature.Feature.CreateDeleteOp

 

8 replies

May 22, 2018 4:11 PM UTC

A component is a feature!

vjoerAuthor
Sep 4, 2018 7:33 AM UTC

Hello

 

Does this mean that a part can be deleted or not?

 

Thank you

Regards

Sep 6, 2018 10:17 PM UTC

JLink Doc

The important J-Link functions for assemblies are those that operate on the components of an assembly. The object ComponentFeat, which is an instance of Feature is defined for that purpose. Each assembly component is treated as a variety of feature, and the integer identifier of the component is also the feature identifier.

 

Regarding your question, you delete a feature, this will delete a member. After this operation you may able to delete the model, if you do not have other dependencies related to the model in session.

sjurajAnswer
Oct 10, 2018 5:27 AM UTC

Model.Delete() cause to remove model from session and disk. To remove model from assembly you need to consider the model as feature (ComponentFeat). You then need to perform component operation on this feature. To remove feature you need to create delete ops and then executre the ops. 

 

pfcSolid.Solid.ExecuteFeatureOps

pfcFeature.Feature.CreateDeleteOp

 

vjoerAuthor
Oct 25, 2018 6:01 AM UTC

Hello

 

When I try to manually delete a part in Creo, I get a window with all children part the reference the current part. I can choose to Fix, Suppress, or Delete the child part.  

When I try to delete the part via JLink,  I dont know how to choose the FIX option for the Child/referencing parts and the references mess up. I end up with a traceback and Creo shuts down.

Can you indicate how can I remove the part in Jlink without affecting the other child parts?

 

Thank you

Regards