Skip to main content
13-Aquamarine
May 14, 2022
Question

Mapkey Toggle Representation of a part (Exclude / Include part from Rep.)

  • May 14, 2022
  • 1 reply
  • 2599 views

Hi guys, I'm continuing my work to turn some of my mapkeys into a toggle (on / off) (Previous mapkey : https://community.ptc.com/t5/Customization/Mapkey-Toggle-Grid-HIDE-Grid-SHOW-Grid/m-p/793262#M11178).

Today, I want to turn a mapkey, which exclude a part of an assembly from a representation, into a toggle where there is the possibility to include back the part.

 

Code to exclude the part :

 

mapkey ee @MAPKEY_LABELExclude the part from the representation;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\
mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;\
mapkey(continued) ~ Trail `MiniToolbar` `MiniToolbar` `UIT_TRANSLUCENT` `NEED_TO_CLOSE`;\
mapkey(continued) ~ Command `ProCmdViewExclude@PopupMenuGraphicWinStack`;

 

Nevertheless, I'm having trouble finding a way to create a mapkey which deactivate the exclusion for the part selected. I want the selected part to go from the status "Exclude" to "No specific status" but I can't find the way to make my mapkey to change the representation for the line that was selected.

 

I'm planning (if there is a solution for this problem) to make something similar to the previous mapkey to create the toggle.

 

Thanks in advance.

1 reply

tbraxton
22-Sapphire II
22-Sapphire II
May 14, 2022

This mapkey will include the part in the rep. Since the part will be excluded, if the rep is active then you cannot pick the part in the graphics window. The user must select the part in the model tree or using a query and then execute this mapkey. The part will be added to the rep. Note that this mapkey does not save the changes to the rep.

Tested in assembly mode (Creo 4) for tree and query selection of a part preceding the execution of the mapkey. The simplified rep subject to change was active when testing this.

 

mapkey ea ~ RButtonArm `main_dlg_cur` `PHTLeft.AssyTree` `node13`;\
mapkey(continued) ~ PopupOver `main_dlg_cur` `PM_PHTLeft.AssyTree` 1 `PHTLeft.AssyTree`;\
mapkey(continued) ~ Open `main_dlg_cur` `PM_PHTLeft.AssyTree`;\
mapkey(continued) ~ Close `main_dlg_cur` `PM_PHTLeft.AssyTree`;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `UIT_TRANSLUCENT` `NEED_TO_CLOSE`;\
mapkey(continued) ~ Command `ProCmdViewNormalMaster@PopupMenuTree`;

 

 

SR_CAD13-AquamarineAuthor
13-Aquamarine
May 14, 2022

Thanks for your response.

I have some questions about your response :

  • Is there a sentence other than "ProCmdViewNormalMaster@PopupMenuTree" which select "No specific status" rather than the "Master representation" ? My problem is that a part in master representation shows his rep. in the tree whereas a part with no specific status doesn't show anything which makes it easier to see excluded parts (as you can see in the example below).

        SR_10295082_1-1652565636237.png

  • Is there a way to keep the selection on the line in the tree (for the selected part) after the execution of the mapkey ? For example, with this I could start the mapkey to exclude a part (after selecting the part in the tree) and when it ends, I could start the mapkey to include the part without having to select the part on the tree once again.

 

 

tbraxton
22-Sapphire II
22-Sapphire II
May 14, 2022

I am not aware of anything in the UI that enables that selection for a part. How are you getting the part in your example with no specific status?

 

The UI options presented for selection are:

 

tbraxton_0-1652567384729.png