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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Mapkey - Select a Plane without using the Mouse?

doneill
12-Amethyst

Mapkey - Select a Plane without using the Mouse?

I would like to create a Mapkey that will select a specific Plane.  Is there a way to do it without using the mouse?  The Plane is not always in the same place in the Model Tree.  

 

Thanks

13 REPLIES 13
TomU
23-Emerald IV
(To:doneill)

Use the find tool.  Just make sure you record all the clicks and picks in your mapkey.

Trebla
15-Moonstone
(To:doneill)

Hi Doneill,

I did it with Search Tool, in this example (creo4) I search for ASM_FRONT:

 

mapkey bb ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Open `selspecdlg0` `SelOptionRadio`;~ Close `selspecdlg0` `SelOptionRadio`;\
mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio` 1 `Datum`;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `ASM_FRONT`;~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;

 

I hope it helps you.

doneill
12-Amethyst
(To:Trebla)

Thanks!

I'll give this a try!

doneill
12-Amethyst
(To:Trebla)

Well, I need to take this a little further...

I want to select the Plane and Rename it.

 

Maybe there is a better way to do this but I have some existing parts and assemblies that

I want to convert from Y-Up coordinate system to Z-Up...

 

 


@doneill wrote:

Well, I need to take this a little further...

I want to select the Plane and Rename it.

 

Maybe there is a better way to do this but I have some existing parts and assemblies that

I want to convert from Y-Up coordinate system to Z-Up...

 

 


Hi,

following mapkey works in CR2

  1. it selects datum plane DTM1 using Search Tool
  2. it renames datum plane to XDTM1 by pressing F2 key

part no.1

mapkey rn ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `DTM1`;\
mapkey(continued) ~ Activate `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;~ Activate `selspecdlg0` `ApplyBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `CancelButton`;\

part no.2

mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.TreeRename`;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `XDTM1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;

 complete mapkey

mapkey rn ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `DTM1`;\
mapkey(continued) ~ Activate `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;~ Activate `selspecdlg0` `ApplyBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.TreeRename`;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `XDTM1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;

 


Martin Hanák

Thanks - a lot of good information here... 

I'm using Creo 4 right now and the code you provided is not working for me....

Basically I want to rename Front and Top planes to the Top and Front... if that makes sense...

 


@doneill wrote:

Thanks - a lot of good information here... 

I'm using Creo 4 right now and the code you provided is not working for me....

Basically I want to rename Front and Top planes to the Top and Front... if that makes sense...

 


Hi,

below you can find mapkey for CR4 (again it renames DTM1 to XDTM1)

 

mapkey rn ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Input `selspecdlg0` `SelOptionRadio` `Feature`;\
mapkey(continued) ~ Input `selspecdlg0` `SelOptionRadio` `Feature`;\
mapkey(continued) ~ Update `selspecdlg0` `SelOptionRadio` `Feature`;\
mapkey(continued) ~ Input `selspecdlg0` `LookByOptionMenu` `Feature`;\
mapkey(continued) ~ Input `selspecdlg0` `LookByOptionMenu` `Feature`;\
mapkey(continued) ~ Update `selspecdlg0` `LookByOptionMenu` `Feature`;\
mapkey(continued) ~ Select `selspecdlg0` `RuleTab` 1 `Attributes`;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` \
mapkey(continued) `DTM1`;~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdRename` ;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `xDTM1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;

 

Note 1:

I do not know whether renaming Front and Top planes to the Top and Front make sense ... test it and you will see.

Note 2:

You have to do 3 renaming steps

a.] TOP > TOPX

b.] FRONT > TOP

c.] TOPX > FRONT


Martin Hanák

Thank you so much!  Everyone here has been a great help!

Took me a little while to get it to behave the way I wanted, but this is what I ended up with...

This works for assemblies...

I made another mapkey for Parts because in Assemblies the names are A_TOP and in Parts it's just TOP.

(I'd like to have just one mapkey if I can figure a way to do it)

 

mapkey rap ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Update `selspecdlg0` `SelOptionRadio` `Feature`;\
mapkey(continued) ~ Update `selspecdlg0` `LookByOptionMenu` `Feature`;\
mapkey(continued) ~ Activate `selspecdlg0` `SelScopeCheck` 0;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `A_RIGHT`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdRename` ;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `RIGHT`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node0`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `CancelButton`;\
mapkey(continued) ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Activate `selspecdlg0` `SelScopeCheck` 0;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `A_TOP`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdRename` ;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `FR1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node0`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `CancelButton`;\
mapkey(continued) ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Activate `selspecdlg0` `SelScopeCheck` 0;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `A_FRONT`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdRename` ;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `TOP`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node0`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `CancelButton`;\
mapkey(continued) ~ Command `ProCmdMdlTreeSearch` ;\
mapkey(continued) ~ Activate `selspecdlg0` `SelScopeCheck` 0;\
mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `FR1`;\
mapkey(continued) ~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Command `ProCmdRename` ;\
mapkey(continued) ~ Update `main_dlg_cur` `PHTLeft.node_edit` `FRONT`;\
mapkey(continued) ~ Activate `main_dlg_cur` `PHTLeft.node_edit`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node0`;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `CancelButton`; 

 

Thanks again!

Mahesh_Sharma
22-Sapphire I
(To:doneill)

@doneill 

If is about renaming Y-Up coordinate system to Z-Up, you can use ModelCHECK as well. 

It will find the CSYS named as Y-Up  and change to Z-Up. 

Thank you...  Now I've learned something about ModelCheck Interactive.  

I think I want to go the Rename route for this situation but this is good information!

Thank you!

Ah - renaming a feature... that can be done quite easily in CREOSON if you wanted to have a script to run it.

 

Basically - you would do this as a code sequence for a single part.

 

feature : list name ="Y-Up"

this will give you the name, feature_id and feature number

feature : rename <featid> "Z-up"

model : regenerate

model : save

 

That basic process could be executed across all your files by simply including it in a loop:

 

creo : list_files *.prt

for each part

     model : open <part>

     // perform above code here on each part...

 

If you have a lot of files to process like that... you should give it a look.

 

Dave

 

 

Thanks - Yeah... If I could write a script for my Mapkey... that would be good... 

CREOSON may be a little bit beyond me at the moment....

FYI - you can execute mapkeys with CREOSON also... but they execute differently than a regular command.

 

If you want to tryCREOSON - i would recommend the CREOPYSON as a starting point... very easy to use and well written as an optional interface toCREOSON.

 

Dave

Top Tags