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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Substitute part in simplified representation


Substitute part in simplified representation

Hey everybody,


I have the following problem:

I want to substitute a part in a simplified representation with another member of the familiy table. However, due to a lack of programming skills, I am unable to do this.


Currently I have to following code to exclude a feature, given its ID:

var simp_rep = solid.GetActiveSimpRep();

var simp_rep_instructions = simp_rep.GetInstructions();

var item_path = pfcCreate ("intseq");
item_path.Append(FEAT_ID); //currently I set the feature Id manually
simp_rep_comp_item_path = pfcCreate("pfcSimpRepCompItemPath").Create(item_path);
simp_rep_item = pfcCreate("pfcSimpRepItem").Create(simp_rep_comp_item_path);
simp_rep_action = pfcCreate("pfcSimpRepExclude").Create();
simp_rep_item.Action = simp_rep_action;


Can somebody help me to modifiy this code to substitute a part (e.g. prt0001.prt) with a family table member (e.g. simplified<prt0001.prt>)?


Any help is greatly appreciated and happy holidays 🙂


Not sure if there is a substitute call available in what you are doing... I would look for that first... because you can manually force that via the UI.


2019-12-22 at 10.10 AM.png



However, one quick way to be a bit more dynamic - would be to use Pro/PROGRAM to create a variable (parameter) for that location in your assembly structure.  This assumes a bit of a consistent process on your end, but works like a charm.


2019-12-22 at 10.06 AM.png


2019-12-22 at 10.05 AM.png



Then a simple parameter change should cause the replacement of the family table item at that location - assuming all the constraints are there for any dependent assembled/referenced components.


2019-12-22 at 10.07 AM.png


Hope that helps.



Thank you very much for your reply and sorry for my late response.

Unfortunately this solutions seems to be not viable for my use case, as I have to apply this script to numerous assemblies. Because of this it would be great to solve this problem using the Creo Web.Link API.

I know from the documentation that this should be possible to do.


Any help from you, or anybody else, to be able to implement this functionality in Web.Link is again greatly appreciated.