Skip to main content
3-Newcomer
February 7, 2024
Question

Quick open drawing from part

  • February 7, 2024
  • 1 reply
  • 4269 views

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.

1 reply

12-Amethyst
February 8, 2024

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;

 

 

24-Ruby III
February 8, 2024

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.

3-Newcomer
March 20, 2024

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.

BH_10112168_0-1710940017938.png

This is probably not the right way to do it.
Can you help?

Thanks