Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hello Team,
-Creo 9 with Windchill.
I'm looking to create a mapkey to quickly open a drawing of a room that's already open.
I've done a lot of research and i can never find a working solution. please don't redirect me to an alternative solution.
I know that a part can have several drawings or be included in other drawings. However, in my case, 90% of the parts created have only one drawing, which has exactly the same name as the part, with .drw instead of .prt.
I've created a relationship: DRAWING = PART_ID+ ".DRW".
I now have a parameter with the right value.
Since copy and paste doesn't work in mapkey commands, is there a line of OS script code that you could put in a mapkey to say, open "parametre drawing"?
I work in a company that doesn't allow third-party applications to be installed.
Thank in advance.
Hello,
I made this mapkey many years ago, not sure if it is still working these days. Try putting it in you config.pro and calling mapkey X.
mapkey x @MAPKEY_NAMEOpen drawing;@MAPKEY_LABELDrawing;\
mapkey(continued) %>partname; %load;\
mapkey(continued) ~ Command `ProCmdModelOpen` ;\
mapkey(continued) ~ Select `file_open` `Type` 1 `db_4`; %partname;\
mapkey(continued) ~ Command `ProFileSelPushOpen_Standard@context_dlg_open_cmd`;
!!!!!!!!!!!!!!!!!!!!!!!!
mapkey >partname @MAPKEY_NAMEGets partname;\
mapkey(continued) ~ Command `ProCmdModelSaveAs` ;~ Select `file_saveas` `type_option` 1 `db_129`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Activate `UI Message Dialog` `ok`;\
mapkey(continued) @SYSTEMdel sw.pro\ndir /b *.pic>filename.txt\nset /p \
mapkey(continued) VAR1=<filename.txt\ndel filename.txt\nSET FILENAME=\%VAR1:\~0,-4\%\necho mapk\
mapkey(continued) ey partname \~ Input `file_open` `EMBED_BROWSER_SEARCH_IP` `%FILENAME%`\\
mapkey(continued) ;>>sw.pro\ndel *.pic;
!!!!!!!!!!!!!!!!!!!!!!!!
mapkey load @MAPKEY_NAMEload mapkey;\
mapkey(continued) ~ Command `ProCmdRibbonOptionsDlg` ;\
mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\
mapkey(continued) ~ Select `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.Open`;\
mapkey(continued) ~ Activate `file_open` `Current Dir`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `sw.pro`;\
mapkey(continued) ~ Update `file_open` `Inputname` `sw.pro`;~ Activate `file_open` `Inputname`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`; @SYSTEMDel sw.pro;
Hi,
OP uses Creo 9 with Windchill. Therefore I am curious where partname.pic will be saved by your mapkey. Maybe it will be necessary to modify the mapkey a little bit to save partname.pic into specific directory.
Yes, you are correct. I don´t use Windchill and all this is done on working directory.
Maybe someone windchill can tweak the mapkey a little to meet the requirements?
Hi,
For Creo with Windchill, you could use this lhoogeveen's mapkey
It works in creo8, I hope it will work also in Creo9...
Hi @Trebla
Thank you for your reply.
I assume you're referring to this one?
mapkey odrw @MAPKEY_NAMEOpen drawing with same name as active model or selected assembly part;\
mapkey(continued) @MAPKEY_LABELOpen Drawing w/ Same Name (odrw);\
mapkey(continued) ~ Command `ProCmdOpenModel@PopupMenuGraphicWinStack`;\
mapkey(continued) ~ Activate `open_instance` `open`;\
mapkey(continued) %>storetmpfile;%>partnameopen;%>loadconf;\
mapkey(continued) ~ Command `ProCmdModelOpen`;\
mapkey(continued) ~ Activate `file_open` `workspace_pb`;\
mapkey(continued) %partnameopen;\
mapkey(continued) ~ Activate `file_open` `Inputname`;
How does this mapkeys work?
When I try to create one in Creo, I am limited by the number of characters I can enter in the OS script tab.
This is probably not the right way to do it.
Can you help?
Thanks
Hi BH,
Yes this is the mapkey, but it is a nested mapkey, so you need also: storetmpfile mapkey, partnameopen mapkey, loadconf mapkey...
If you take only a piece, it will never work.
sorry I do not know the tricks about OS mapkeys , I can tell you that this one works fine:
mapkey odrw @MAPKEY_NAMEOpen drawing with same name as active model or selected assembly part;\
mapkey(continued) @MAPKEY_LABELOpen Drawing w/ Same Name (odrw);\
mapkey(continued) ~ Command `ProCmdOpenModel@PopupMenuGraphicWinStack`;\
mapkey(continued) ~ Activate `open_instance` `open`;\
mapkey(continued) %>storetmpfile;%>partnameopen;%>loadconf;\
mapkey(continued) ~ Command `ProCmdModelOpen`;\
mapkey(continued) ~ Activate `file_open` `workspace_pb`;\
mapkey(continued) %partnameopen;\
mapkey(continued) ~ Activate `file_open` `Inputname`;
!======================
mapkey >storetmpfile @@MAPKEY_LABELStore model name to temp file;
mapkey(continued) ~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) #CURRENT VALS;\
mapkey(continued) ~ Activate `storage_conflicts` `Close_PushButton`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_129`;\
mapkey(continued) ~ Activate `file_saveas` `check_is_secondary` 0;\
mapkey(continued) ~ Activate `file_saveas` `Current Dir`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;\
mapkey(continued) ~ Activate `UI Message Dialog` `ok`;
mapkey >partnameopen @MAPKEY_LABELGets partname to open drawing;\
mapkey(continued) @SYSTEMdel sw.pro\n\
mapkey(continued) dir /b *.pic>\%temp\%\\filename.txt\n\
mapkey(continued) set /p VAR1=<\%temp\%\\filename.txt\n\
mapkey(continued) del \%temp\%\\filename.txt\n\
mapkey(continued) set FILENAME=\%VAR1:\~0,-4\%\n\
mapkey(continued) echo mapkey partnameopen \~ Update `file_open` \
mapkey(continued) `Inputname` `\%FILENAME\%.drw`\;>>sw.pro\n\
mapkey(continued) del *.pic;
mapkey >partnamenew @MAPKEY_LABELGets partname for new part;\
mapkey(continued) @SYSTEMdel sw.pro\n\
mapkey(continued) dir /b *.pic>\%temp\%\\filename.txt\n\
mapkey(continued) set /p VAR1=<\%temp\%\\filename.txt\n\
mapkey(continued) del \%temp\%\\filename.txt\n\
mapkey(continued) set FILENAME=\%VAR1:\~0,-4\%\n\
mapkey(continued) echo mapkey partnamenew \~ Input `new` \
mapkey(continued) `InputPanel1` `\%FILENAME\%`\;>>sw.pro\n\
mapkey(continued) del *.pic;
mapkey >loadconf @MAPKEY_LABELLoad mapkey into session;\
mapkey(continued) ~ Command `ProCmdRibbonOptionsDlg`;\
mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.Open`;\
mapkey(continued) ~ Activate `file_open` `Current Dir`;\
mapkey(continued) ~ Update `file_open` `Inputname` `sw.pro`;\
mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd`;\
mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;\
mapkey(continued) ~ Activate `UITools Msg Dialog Future` `no`;\
mapkey(continued) @SYSTEMDel sw.pro;
!======================