Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
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
Solved! Go to Solution.
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
A component is a feature!
Hello
Does this mean that a part can be deleted or not?
Thank you
Regards
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.
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
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
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
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
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.