Skip to main content
11-Garnet
July 6, 2025
Solved

Simplifed Representation: All assembly items to user defined representation automatically

  • July 6, 2025
  • 3 replies
  • 774 views

Is there away to make a representation that puts all sub models in a assembly to a defined user defined representation?

 

So lets say that company standard defines that each part model has following custom representations:

 

* Medium_Rep

* Low_Rep

 

So one way would be to have a representation in assembly level that is also called Medium_Rep and Low_Rep that would automatically set every part to their .respective representation. We can off course do this manually one by one, but is there a way to automate setting of user representation in bulk? Or even entirely automatically?

Best answer by Chris3

There is no easy way to do this that I am aware of. It can be done with automation though. Either Toolkit or mapkeys. I can't document how to do it in toolkit, but to do it with mapkeys, you would need to create a dynamic mapkey.

 

See creating dynamic mapkeys here:

https://community.ptc.com/sejnu66972/attachments/sejnu66972/customization/13797/1/VG-4052%20Dynamic%20Mapkeys%20to%20Automate%20Creo%202024-01-23.pdf 

 

You would start with a list of the components in the assembly (which you could export with a mapkey). Then you would take the mapkey below and use an outside script (like vbs or powershell) to copy and paste changing the bits that are needed to be changed.

 

In the mapkey below the PRT0001 and NO_FEATURES would need to change. So for the first component PRT0001 becomes gear.prt and NO_Features becomes Medium_Rep and then you copy and paste the mapkey again (without the begininning bit and with an extra \ (see presentation) for the next part. So the next 17 lines of the mapkey are the same only gear.prt becomes cog.prt and whatever rep name you want for cog.prt

 

mapkey defaultsimprep @MAPKEY_NAMESet everything to a named rep;\
mapkey(continued) @MAPKEY_LABELSimpRep;~ Command `ProCmdViewVisTool` ;\
mapkey(continued) ~ Activate `visual_dlg0` `ZoneNmCreate`;~ Activate `UI Message Dialog` `no`;\
mapkey(continued) ~ Update `visual_dlg0` `Table_INPUT` `DefaultSimpReps`;\
mapkey(continued) ~ Activate `visual_dlg0` `Table_INPUT`;\
mapkey(continued) ~ Select `new_simp_rep_ui` `PHGenEdtTool.Select`;\
mapkey(continued) ~ Close `new_simp_rep_ui` `PHGenEdtTool.Select`;\
mapkey(continued) ~ Activate `new_simp_rep_ui` `SearchBtn`;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `*PRT0001*`;~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ RButtonArm `new_simp_rep_ui` `PHGenEdtTool.AssyTree` `node1`;\
mapkey(continued) ~ Select `new_simp_rep_ui` `Representation`;\
mapkey(continued) ~ Close `new_simp_rep_ui` `RepActionMenu`;\
mapkey(continued) ~ Activate `new_simp_rep_ui` `UDRepState`;\
mapkey(continued) ~ FocusIn `new_simp_rep_ui` `PHGenEdtTool.AssyTree`;\
mapkey(continued) ~ Select `usrdefitems` `ItemsList` 1 `NO_FEATURES`;\
mapkey(continued) ~ Activate `usrdefitems` `AcceptBtn`;~ Activate `new_simp_rep_ui` `OkButton`;\
mapkey(continued) ~ Activate `visual_dlg0` `CloseBtn`;

 

3 replies

Community Moderator
July 11, 2025

Hi @joojaa

Thank you for reaching out with your question.

To assist you better, could you please provide more details and context regarding your inquiry? Specifically:
 

  • Is the main goal to reduce file size, improve performance, or standardize visualization across teams?
  • Are you looking to apply this to all assemblies across multiple projects, or just within a specific assembly?
  • Do all parts consistently have the same user-defined representations (e.g., Medium_Rep, Low_Rep), or are there exceptions?
  • Would you want this automation to run once during setup, or dynamically update as parts are added or changed?

Including screenshots can also be very helpful in understanding your process. This will enhance the likelihood of receiving valuable assistance from other Community members.

You might also find it useful to refer to the guide on how to ask a good question. 
Additionally, our community champion has shared tips on key points to include when asking a question on the PTC Community.
I hope this information is helpful.

I am replying to raise awareness. Hopefully, another community member will be able to help.

Best Regards,
Vivek N
Community Moderation Team.




 

joojaa11-GarnetAuthor
11-Garnet
July 17, 2025

All files, all assemblies, all projects. Dynamically would be great as it would be great not to have to muck around with the representation when adding or creating new components.

 

Chris321-Topaz IAnswer
21-Topaz I
July 11, 2025

There is no easy way to do this that I am aware of. It can be done with automation though. Either Toolkit or mapkeys. I can't document how to do it in toolkit, but to do it with mapkeys, you would need to create a dynamic mapkey.

 

See creating dynamic mapkeys here:

https://community.ptc.com/sejnu66972/attachments/sejnu66972/customization/13797/1/VG-4052%20Dynamic%20Mapkeys%20to%20Automate%20Creo%202024-01-23.pdf 

 

You would start with a list of the components in the assembly (which you could export with a mapkey). Then you would take the mapkey below and use an outside script (like vbs or powershell) to copy and paste changing the bits that are needed to be changed.

 

In the mapkey below the PRT0001 and NO_FEATURES would need to change. So for the first component PRT0001 becomes gear.prt and NO_Features becomes Medium_Rep and then you copy and paste the mapkey again (without the begininning bit and with an extra \ (see presentation) for the next part. So the next 17 lines of the mapkey are the same only gear.prt becomes cog.prt and whatever rep name you want for cog.prt

 

mapkey defaultsimprep @MAPKEY_NAMESet everything to a named rep;\
mapkey(continued) @MAPKEY_LABELSimpRep;~ Command `ProCmdViewVisTool` ;\
mapkey(continued) ~ Activate `visual_dlg0` `ZoneNmCreate`;~ Activate `UI Message Dialog` `no`;\
mapkey(continued) ~ Update `visual_dlg0` `Table_INPUT` `DefaultSimpReps`;\
mapkey(continued) ~ Activate `visual_dlg0` `Table_INPUT`;\
mapkey(continued) ~ Select `new_simp_rep_ui` `PHGenEdtTool.Select`;\
mapkey(continued) ~ Close `new_simp_rep_ui` `PHGenEdtTool.Select`;\
mapkey(continued) ~ Activate `new_simp_rep_ui` `SearchBtn`;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `*PRT0001*`;~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ RButtonArm `new_simp_rep_ui` `PHGenEdtTool.AssyTree` `node1`;\
mapkey(continued) ~ Select `new_simp_rep_ui` `Representation`;\
mapkey(continued) ~ Close `new_simp_rep_ui` `RepActionMenu`;\
mapkey(continued) ~ Activate `new_simp_rep_ui` `UDRepState`;\
mapkey(continued) ~ FocusIn `new_simp_rep_ui` `PHGenEdtTool.AssyTree`;\
mapkey(continued) ~ Select `usrdefitems` `ItemsList` 1 `NO_FEATURES`;\
mapkey(continued) ~ Activate `usrdefitems` `AcceptBtn`;~ Activate `new_simp_rep_ui` `OkButton`;\
mapkey(continued) ~ Activate `visual_dlg0` `CloseBtn`;

 

joojaa11-GarnetAuthor
11-Garnet
July 17, 2025

Yeah, that is what i was afraid of. I will just try to whip up something with the VB API using python (the VB API is misnamed, its not a VB API its a COM API you can use whatever language you like to trigger it). Not optimal but less painful. But a really evident feature that the layers should have. 

 

Ideally, I would like to do something similar to how sheet metal handles Flat pattern representations. So that i could have Master Rep be Medium_Rep and then have a Super master Representation called High_Rep instead that would include all the mostly day to day not needed complexity.

 

But since i am going the scripting route I might as well consider the alternate solutions presented to me. 

 

 

Community Moderator
July 14, 2025

Hello @joojaa,

 

It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.