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

Access to replace unrelated component API in Toolkit

5-Regular Member

Access to replace unrelated component API in Toolkit

Asking for enhancement to Creo Parametric to have API access to Replace Unrelated Component:

This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

Hello Robert,

enhancement requests should be filed as Product Ideas - this will allow other users to vote and comment on the idea.




Although you can't really do this as easily as you would in the GUI, you can already do this using functions already in the API.

When you get a chance, check the feature element tree for a ProAsmcomp. (/protoolkit/protkdoc/api/proasmcomp_h.html)

Essentially, once you have a selection to a component in your tree, you could use

  • Get the current constraints of the ProAsmComp
  • ProFeatureElemtreeExtract to get the feature element tree
  • Change the element for PRO_E_COMPONENT_MODEL using ProElementSpecialvalueSet
  • change the elements for the constraints as-needed to be references from the new model instead of from the old model
  • use ProFeatureWithoptionsRedefine to "finish" the feature

Its a bit of a pain... but I believe it can technically be done . Let me know if you need more-specific pseudo-code. It can be done similarly using the OTK APi if you need that one instead, but I don't have as much personal experience with that APi yet.

President & Founder
CadActive Technologies -
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.

NEW Creo+ Topics:
PTC Control Center
Creo+ Portal
Real-time Collaboration