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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Translate the entire conversation x

Mapkey to open drawing with the name of the current prt or asm

RobertH
15-Moonstone

Mapkey to open drawing with the name of the current prt or asm

This topic is related to this one but the moderator advised me to open a new topic so here it is.

 

I know there are several examples (like the one in the linked topic above) and had one working in the past but we updated to Creo 11 and now this "open drawing with the name of the open part or asm" mapkey doesn't work anymore and can't get it to work.

 

I'm aware of the case that the mapkeys are not embedded anymore in the config.pro. I have some mapkeys that are working or are working again so how the new mapkeys work I know..

 

So who has a working mapkey or can help me with this?

ACCEPTED SOLUTION

Accepted Solutions
RobertH
15-Moonstone
(To:RobertH)

As I don't like to download and execute .exe files, I've found another mapkey and adjusted it in order to let it work

!###########################################################################
mapkey exp_mdl_name_tree @MAPKEY_LABELExport model name tree;~ Command `ProCmdMdlTreeSaveAsText`;\
mapkey(continued) ~ Activate `file_open` `Current Dir`;~ Update `inputname` `InpName` `tree.txt`;\
mapkey(continued) ~ Activate `inputname` `okbutton`;

!###########################################################################
mapkey get_am_names @MAPKEY_LABELGet active model name;%exp_mdl_name_tree;\
mapkey(continued) @SYSTEMdel am.pro\nsetlocal enabledelayedexpansion\nfor /f "skip=2 tokens=*" \
mapkey(continued) \%\%i in (tree.txt) do (set l=\%\%i & goto END)\n:END\nfor /f "delims=<." \
mapkey(continued) \%\%a in ("\%l\%") do set mn=\%\%a\necho mapkey am_names \~ Update \
mapkey(continued) `file_open` `Inputname` `\%mn\%`\;>>am.pro\ndel tree.txt\nendlocal;

!###########################################################################
mapkey load_am_names_mapkey @MAPKEY_LABELLoad "am_names" mapkey into config;\
mapkey(continued) ~ Command `ProCmdUtilMacros` ;\
mapkey(continued) ~ Select `mapkey_main` `ImpExpCascButton`;\
mapkey(continued) ~ Activate `mapkey_main` `psh_import`;\
mapkey(continued) ~ Trail `` `` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `am.pro`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `am.pro`;\
mapkey(continued) ~ Activate `mapkey_main` `CloseButton`;\
mapkey(continued) ~ FocusIn `unsaved_mapkeys` `yes`;\
mapkey(continued) ~ Activate `unsaved_mapkeys` `yes`;@SYSTEMDel am.pro;

!###########################################################################
mapkey odrw @MAPKEY_LABELOpen drawing;\
mapkey(continued) @MAPKEY_LABELOpen drawing of active model;\
mapkey(continued) %get_am_names;%load_am_names_mapkey;~ Command `ProCmdModelOpen`;\
mapkey(continued) ~ Select `file_open` `Type` 1 `db_4`;%am_names;\
mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd`;

View solution in original post

3 REPLIES 3

Hi,

couple of days ago I tested my AutoIT script with Creo 11.0.2.0 successfully. I attached it to this reply.

Note 1: The script is launched by mapkey dd. Its definition must contain proper path to exe file.

Note 2: In your environment my exe file can be blocked by, for example, an antivirus program.


Martin Hanák

Hello @RobertH,

 

It looks like you have a response from a community expert. 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.

RobertH
15-Moonstone
(To:RobertH)

As I don't like to download and execute .exe files, I've found another mapkey and adjusted it in order to let it work

!###########################################################################
mapkey exp_mdl_name_tree @MAPKEY_LABELExport model name tree;~ Command `ProCmdMdlTreeSaveAsText`;\
mapkey(continued) ~ Activate `file_open` `Current Dir`;~ Update `inputname` `InpName` `tree.txt`;\
mapkey(continued) ~ Activate `inputname` `okbutton`;

!###########################################################################
mapkey get_am_names @MAPKEY_LABELGet active model name;%exp_mdl_name_tree;\
mapkey(continued) @SYSTEMdel am.pro\nsetlocal enabledelayedexpansion\nfor /f "skip=2 tokens=*" \
mapkey(continued) \%\%i in (tree.txt) do (set l=\%\%i & goto END)\n:END\nfor /f "delims=<." \
mapkey(continued) \%\%a in ("\%l\%") do set mn=\%\%a\necho mapkey am_names \~ Update \
mapkey(continued) `file_open` `Inputname` `\%mn\%`\;>>am.pro\ndel tree.txt\nendlocal;

!###########################################################################
mapkey load_am_names_mapkey @MAPKEY_LABELLoad "am_names" mapkey into config;\
mapkey(continued) ~ Command `ProCmdUtilMacros` ;\
mapkey(continued) ~ Select `mapkey_main` `ImpExpCascButton`;\
mapkey(continued) ~ Activate `mapkey_main` `psh_import`;\
mapkey(continued) ~ Trail `` `` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `am.pro`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `am.pro`;\
mapkey(continued) ~ Activate `mapkey_main` `CloseButton`;\
mapkey(continued) ~ FocusIn `unsaved_mapkeys` `yes`;\
mapkey(continued) ~ Activate `unsaved_mapkeys` `yes`;@SYSTEMDel am.pro;

!###########################################################################
mapkey odrw @MAPKEY_LABELOpen drawing;\
mapkey(continued) @MAPKEY_LABELOpen drawing of active model;\
mapkey(continued) %get_am_names;%load_am_names_mapkey;~ Command `ProCmdModelOpen`;\
mapkey(continued) ~ Select `file_open` `Type` 1 `db_4`;%am_names;\
mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd`;
Announcements
NEW Creo+ Topics: Real-time Collaboration

Top Tags