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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

mapkey trouble in Creo 2.0

RV_5434567
10-Marble

mapkey trouble in Creo 2.0

Hello,

 

 

Recently our company upgraded from PRO/E WF2 to CREO2.

 

 

I had made a bunch of mapkeys to speed up detailing of drawings, for exemple:

 

 

)) would put the selected dimensions between brackets: dim > (dim)

*2 would add (2x) behind the dim: dim > dim(2x)

 

 

This is how they looked in de Pro/E config:

 

 

mapkey )) @MAPKEY_LABELHAAKJES;~ Close `main_dlg_cur` `MenuBar1`;\

mapkey(continued) ~ Activate `main_dlg_cur` `Edit.psh_dwg_props`;\

mapkey(continued) ~ Select `mod_dim_asynch` `tab_main`1 `lay_dim_text`;\

mapkey(continued) ~ FocusIn `mod_dim_asynch` `inp_dim_prefix`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_prefix` `(`;\

mapkey(continued) ~ Update `mod_dim_asynch` `inp_dim_prefix` `(`;\

mapkey(continued) ~ FocusOut `mod_dim_asynch` `inp_dim_prefix`;\

mapkey(continued) ~ FocusIn `mod_dim_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_postfix` `)`;\

mapkey(continued) ~ Update `mod_dim_asynch` `inp_dim_postfix` `)`;\

mapkey(continued) ~ FocusOut `mod_dim_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Activate `mod_dim_asynch` `psh_ok`;

 

mapkey *2 @MAPKEY_LABEL2x;~ Activate `main_dlg_cur` `Edit.psh_dwg_props`;\

mapkey(continued) ~ Select `mod_dim_asynch` `tab_main`1 `lay_dim_text`;\

mapkey(continued) ~ FocusIn `mod_dim_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_postfix` `(`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_postfix` `(2`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_postfix` `(2x`;\

mapkey(continued) ~ Input `mod_dim_asynch` `inp_dim_postfix` `(2x)`;\

mapkey(continued) ~ Update `mod_dim_asynch` `inp_dim_postfix` `(2x)`;\

mapkey(continued) ~ FocusOut `mod_dim_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Activate `mod_dim_asynch` `psh_ok`;

 

 

This eased up detailing of the drawing, and the different mapkeys could be combined, i.e.:

 

select dim + press )) + press *2 = (dim)(2x)

 

Also notice how I never used RMB to go to dimension properties. I always used the menubar. The first versions of my *-mapkeys used the RMB and sometimes they stopped working in the middle of a session. Going trough the menubar, that never happened again.

 

And now on to Creo 2.0.

First problem, there is no more menubar! And there's also no button for dimprop in the ribbon. Command Search doesn't find anything like it either. So now I'm forced to use RMB. Here are the new versions of these mapkeys in Creo:

(never mind the smiley, it's a ; and a \ actually)

 

mapkey )) @MAPKEY_LABELhaakjes;\

mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\

mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;~ Command `ProCmdEditProperties`

mapkey(continued) ~ Select `mod_dim_new_asynch` `tab_main` 1 `lay_display`;\

mapkey(continued) ~ FocusIn `mod_dim_new_asynch` `inp_dim_prefix`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_prefix` `(`;\

mapkey(continued) ~ FocusOut `mod_dim_new_asynch` `inp_dim_prefix`;\

mapkey(continued) ~ Update `mod_dim_new_asynch` `inp_dim_prefix` `(`;\

mapkey(continued) ~ FocusIn `mod_dim_new_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_postfix` `)`;\

mapkey(continued) ~ Update `mod_dim_new_asynch` `inp_dim_postfix` `)`;\

mapkey(continued) ~ FocusOut `mod_dim_new_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Activate `mod_dim_new_asynch` `psh_ok`;

 

mapkey *2 @MAPKEY_LABELx2;\

mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `popupMenuRMBTimerCB`;\

mapkey(continued) ~ Close `rmb_popup` `PopupMenu`;~ Command `ProCmdEditProperties`

mapkey(continued) ~ Select `mod_dim_new_asynch` `tab_main` 1 `lay_display`;\

mapkey(continued) ~ FocusIn `mod_dim_new_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_postfix` `(`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_postfix` `(2`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_postfix` `(2x`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `inp_dim_postfix` `(2x)`;\

mapkey(continued) ~ Update `mod_dim_new_asynch` `inp_dim_postfix` `(2x)`;\

mapkey(continued) ~ FocusOut `mod_dim_new_asynch` `inp_dim_postfix`;\

mapkey(continued) ~ Activate `mod_dim_new_asynch` `psh_ok`;

 

 

Using the RMB I'm willing to accept, but the bigger problem is they do not combine anymore, i.e.:

 

select dim + press )) + press *2 = (dim(2x)

 

As you can see the brackets around the dim are not closed anymore. This is because in WF2, when you filled out a prefix and a suffix, after 'OK' and exiting dimprop, it would be added to the dimension, freeing the prefix and suffix square for new entries. Now it keeps it in the square, overwriting it when an other mapkey is used.

 

Does anybody have a solution to my problem, or perhaps some examples of brand new Creo2 mapkeys they made themselves?


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
16 REPLIES 16
James62
12-Amethyst
(To:RV_5434567)

hi,

In WF4 it also works such that Prefix and Sufix gets appended to dimension text after the Dimension Properties window closes.

No idea why they changed the behaviour in Creo Parametric, it's pretty tough to append these parentheses () to a dim that already has a prefix or sufix when it behaves this way. I mean, it's not doable just with Creo mapkeys for sure.

Inoram
14-Alexandrite
(To:RV_5434567)

Your message prompted me to go make some mapkeys that I have been meaning to make for a while now.

When I make (dims), I just use Ref Dimensions instead of Dimenisons.

I made a mapkey for adding a diameter symbol in front of a dimension like for linear dimsions and I put that in the Prefix part, I also created a (2) mapkey but instead of putting that in the suffix area, I but it right in the text window so the 2 don't cancel each other out. I am going to try this in workflow and see if it works they way I think it should.

I created one to do what I think you are looking for and it works for me:

mapkey )) @MAPKEY_LABELReference_Dim;\

mapkey(continued) ~ Command `ProCmdEditProperties`;\

mapkey(continued) ~ Select `mod_dim_new_asynch` `tab_main` 1 `lay_display`;\

mapkey(continued) ~ FocusIn `mod_dim_new_asynch` `txt_dim_text`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D)`;\

mapkey(continued) ~ Update `mod_dim_new_asynch` `txt_dim_text` `(@D)`;\

mapkey(continued) ~ FocusOut `mod_dim_new_asynch` `txt_dim_text`;\

mapkey(continued) ~ Activate `mod_dim_new_asynch` `psh_ok`;

mapkey *2 @MAPKEY_LABEL2X;\

mapkey(continued) ~ Command `ProCmdEditProperties`;\

mapkey(continued) ~ Select `mod_dim_new_asynch` `tab_main` 1 `lay_display`;\

mapkey(continued) ~ FocusIn `mod_dim_new_asynch` `txt_dim_text`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D)(`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D)(2`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D)(2X`;\

mapkey(continued) ~ Input `mod_dim_new_asynch` `txt_dim_text` `(@D)(2X)`;\

mapkey(continued) ~ Update `mod_dim_new_asynch` `txt_dim_text` `(@D)(2X)`;\

mapkey(continued) ~ FocusOut `mod_dim_new_asynch` `txt_dim_text`;\

mapkey(continued) ~ Activate `mod_dim_new_asynch` `psh_ok`;

Had to remove a few spaces to keep the smilies from infesting the code...hopefully that doesn't affect the mapkeys.

Nevermind, I'm seeing what the problem is now. Looks like you'll need to create a separate mapkey for adding )(2X) at the end of a dimension.

In the mean time I found a partial solution to my own problem.

If you add the brackets to the prefix and suffix, and add the (2x) to the dimension text, it works. However, this solution doesn't satisfy me, because I also had mapkeys for adding a diameter symbol (Ø), or an M for metric, which will no longer work.

If anyone knows a decent solution (ie. making it work like the Ol' Days), I would be glad to hear it...

2xhaak.png

Inoram
14-Alexandrite
(To:RV_5434567)

maybe another mapkey for ref dimensions with (Ø in the prefix.


I don't want to burden myself and my coworkers with to much mapkeys.

One symbol, One mapkey. Combining symbols should be a matter of typing several mapkeys in a row, otherwise it will get to complicated.

James62
12-Amethyst
(To:RV_5434567)

Rob, what you want is not doable just with Creo mapkeys.

To fake this old functionality, which is now gone, I'd make at least two scripts in Autohotkey, and then mapkeys to run these scripts.

I'll probably make them later in the future once this starts to bother me, but right now that seems like much work.

The way Creo works now I doubt you can do this with mapkeys.

Maybe the best option here is a external script: Autohotkey or Autoit (they are similar).

These programs send a series of programmed keystrokes to Creo. They aren´t so robust as mapkeys but in some situations are the best options.

This is how I would do it with Autoit:

WinWaitActive ("Dimension Properties"); Waits for the window of Dimension Properties to be active

Send("{RIGHT}^{TAB 6}{END}"); Sends a sequence of Keystrokes

Send("("); sends text for preffix

Send("{TAB}{HOME}")

Send(")"); sends text for suffix

Send("{TAB 10}{Enter}"); Sends a sequence of Keystrokes

Ok,

Step by step tutorial:

1 - Put the following lines in the end of your Config.pro and save:

mapkey )) @MAPKEY_LABELReference_Dim;\

mapkey(continued) @SYSTEMStart c:\\creo-macros\\)).exe;\

mapkey(continued) ~ Command `ProCmdEditProperties`;

mapkey *2 @MAPKEY_LABEL2X;\

mapkey(continued) @SYSTEMStart c:\\creo-macros\\x2.exe;\

mapkey(continued) ~ Command `ProCmdEditProperties`;

2 - Download attached zip file.

3 - Extract files from zip to a new folder c:\creo-macros

4 - (Re)Start Creo and run the mapkeys.

Good luck.

Jose

Jose, thanks for the contribution.

The thing works very well on linear dimensions, even in reversed order - first *2 and then )) gives the correct (dim)(x2) instead of previously in WF2 (dim(x2)).

However it doesn't work on radii and diameters, and neither on ordinate dims.

Also, is there a way I can see the code behind these exe's? I tried to open it with AutoIT, but that didn't work. I'd like to know what it looks like inside, so I can make more of these (next to *2 there used to be a *3, *4 , *m, *d, *h, etc...).

tleati
12-Amethyst
(To:Jose_Costa)

Hello Jose,

relating to this topic I would have some questions to ask you for a help concerning the call to external script files from inside a mapkey.

I need to record a mapkey which opens the "file open" window and then places the curson in the dynamic filter bar ("search..."):

1.PNG

and I usually do this last operation by pressing 3 times TAB key.

Well, given that by simply recording the mapkey doesn't recognize the press of the tab key, nor the click with the mouse, I am thinking about editing an autohotkey script which does the 3 times TAB key press, to then recall it from the mapkey itself.

- In your comment line "mapkey(continued) @SYSTEMStart c:\\creo-macros\\)).exe;\", what does it mean "@SYSTEMstart"? could I omiss it in my case? (I work with embedded Windchill so I don't use working directory command).

- should the script file be .exe or can it be also .ahk?

Also, as an alternative of editing the config.pro, I read about the OS Script tap in mapkey definition window but didn't understand whether in this tab should I put directly the path to the .exe (or .ahk) file, or instead the whole code of the mapkey.

(If you have other suggestions they are welcome by the way).

many thanks

bye

Tommaso

James62
12-Amethyst
(To:tleati)

Hi,

I recommend making a new thread for this question. Or put a link here if you already have one.

To answer the part of your question related to this thread, OS Script is closely related to batch scripting. That basically means if you can run a file via the Windows command line you can run it using OS Script.

Creo Tutorial: How to open external file with Mapkey - YouTube

~J

tleati
12-Amethyst
(To:James62)

Hi James,

 

yes in fact I had already opened a thread on my specific inquiry:

 

Solved: Re: Mapkey to open parts with cursor in search bar - PTC Community

 

that has just been solved today with a mapkey without external file opening. (yesterday, I had tried and finally solved it also with a mapkey with an external link to a script, hence the reason of my reply here).

In the tread you'll find both the script and the mapkey codes, if you may be interested in.

 

Thank you for the tip, indeed I was thinking the os script option could open just specific command line file (VB script), instead any file may be open indeed.

This possibility is very powerful...plenty of thing that can be automated.

 

bye

 

Tommaso

Hi Robbie,

the code is what I gave you before:

WinWaitActive ("Dimension Properties"); Waits for the window of Dimension Properties to be active

Send("{RIGHT}^{TAB 6}{END}"); Sends a sequence of Keystrokes

Send("("); sends text for preffix

Send("{TAB}{HOME}")

Send(")"); sends text for suffix

Send("{TAB 10}{Enter}"); Sends a sequence of Keystrokes

this one for )).exe

The other I don´t have here right now. I have to take a look later.

Ok Robbie,

I see where the problem is. I used only simulated keystrokes to do this and this can´t be done this way because on other types of dimensions, some fields are disabled, so the number of keystrokes to reach a button is different.

I changed the code a little bit to focus directly the prefix and suffix fields. Try this new files.

I think i´m not being very clear but if you take a look at the code files you will see what I mean.

Keeping the code files is a nice way to build more macros by yourself .

Cheers.

Jose

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags