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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

SR_CAD
12-Amethyst

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

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.

7 REPLIES 7
tbraxton
21-Topaz II
(To:SR_CAD)

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`;

 

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
12-Amethyst
(To:tbraxton)

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
21-Topaz II
(To:SR_CAD)

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

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
12-Amethyst
(To:tbraxton)

I have the same UI options, the only way I found to go back to "no specific status" is with this method :

SR_10295082_0-1652621695480.png

Aucun statut explicite = No specific status

By default, when I add a part in an assembly it's directly with no specific status.

The only thing you need in the mapkey is the 'ProCmdView..." line.

In total, I found 3 commands that affect state of the selected component in the active simplified rep:

 

mapkey xx @MAPKEY_LABELSimp Rep stuff;\
~ Command `ProCmdViewExclude@PopupMenuTree`;

! ~ Command `ProCmdViewAutomaticOnly@PopupMenuTree`;
! ~ Command `ProCmdViewNormalMaster@PopupMenuTree`;

 

- assign state "excluded" (shown above)

or:

- assign state "automatic rep"

- assign state "master rep"

(in commented out lines)

 

I wasn't able to find a 'ProCmd..." command that will "clear" the state assignment of the selected component and make it  assume the "derived" from top level state (i.e., the "no explicit status" in the model tree)

 

Perhaps you an ask PTC if such a command exists; I have a feeling they might not tell you or advise that such a function is only accessible via the actions you shown or via the "remove" button in view manager / simp rep editor:

pausob_0-1652741216925.png

 

Obviously, this would make it very difficult to make a reusable mapkey as the GUI interactions rely on items being in specific row of the table, etc...

 

 

 

tbraxton
21-Topaz II
(To:SR_CAD)

I am still not clear on what actions by the user create the no specific status state. This is something I would need to understand to figure out if it can be integrated. There may be a command sequence that you can add to get the no specific status. You can use a trail file to investigate the command sequence recorded to implement the no specific status state for a component within the assembly. If you can extract that from the trail file, you can try editing the mapkey with this command copied from the trail file.

 

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
12-Amethyst
(To:tbraxton)

Hi guys, sorry for the delayed response.

As requested here are additional informations on the status : "No specific status".

 

Here is a video showing how I put the no specific status state :

 

Here is the code to put the no specific status state on a piece as shown on the video (from 10s to 18s) :

mapkey nss @MAPKEY_LABELNo specific status;\
mapkey(continued) ~ CellSelect `main_dlg_cur` `PHTLeft.AssyTree` `node5` `ac0`;\
mapkey(continued) ~ Open `main_dlg_cur` `PHTLeft.DropDown`;\
mapkey(continued) ~ Close `main_dlg_cur` `PHTLeft.DropDown`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.DropDown` 1 `0`;\
mapkey(continued) ~ FocusOut `main_dlg_cur` `PHTLeft.DropDown`;

 

Here is the code to put the no specific status state on a piece with the view manager, as suggested by pausob :

mapkey 2nss @MAPKEY_LABELNo specific status V2;\
mapkey(continued) ~ Command `ProCmdViewVisTool` ;\
mapkey(continued) ~ Arm `visual_dlg0` `Table` 2 `default` `name_column`;\
mapkey(continued) ~ Select `visual_dlg0` `Table` 2 `default` `name_column`;\
mapkey(continued) ~ Activate `visual_dlg0` `PropertiesBtn`;\
mapkey(continued) ~ Select `visual_dlg0` `ExtLay.ItemRefList` 1 `-1:69:[40]`;\
mapkey(continued) ~ Activate `visual_dlg0` `ExtLay.RemoveOperationButton`;\
mapkey(continued) ~ Close `visual_dlg0` `visual_dlg0`;

 

Top Tags