cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete components in jlink

SOLVED
Regular Member

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  

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Delete components in jlink

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

 

View solution in original post

7 REPLIES 7

Re: Delete components in jlink

A component is a feature!

Re: Delete components in jlink

Hello

 

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

 

Thank you

Regards

Re: Delete components in jlink

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.

Re: Delete components in jlink

Hello

 

From what you said I understand that I have first to delete all features in a model and then I can delete the model itself.

I tried this approach and this failed: I get an error xtoolkitbadcontext every time I try to delete a feature from a model.

Any idea what I am missing?

I am doing this via jlink on a step file opened in Creo.

 

Thank you

 

Regards

Highlighted

Re: Delete components in jlink

Hello

 

The model that I try to delete has been used to create a UDF. Is it now possible to delete the model with jlink?

I seem to get an error when doing this.

 

Thank you

Re: Delete components in jlink

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

 

View solution in original post

Re: Delete components in jlink

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

Announcements