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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Delete components in jlink

vjoer
7-Bedrock

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  

ACCEPTED SOLUTION

Accepted Solutions
sjuraj
15-Moonstone
(To:vjoer)

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

8 REPLIES 8
RPN
17-Peridot
17-Peridot
(To:vjoer)

A component is a feature!

vjoer
7-Bedrock
(To:RPN)

Hello

 

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

 

Thank you

Regards

RPN
17-Peridot
17-Peridot
(To:vjoer)

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.

vjoer
7-Bedrock
(To:RPN)

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

vjoer
7-Bedrock
(To:RPN)

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

sjuraj
15-Moonstone
(To:vjoer)

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

 

vjoer
7-Bedrock
(To:sjuraj)

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

Vishnu_N
7-Bedrock
(To:sjuraj)

while deleting like you said i am getting error like "toolkit general error "because that perticular model reference are there so how can i delete a model without their references.

 

Announcements


Top Tags