Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Has anybody managed some sort of shortcut/mapkey for this yet? I'm taking about quickly opening a drawing of same name when the model is on screen, the way you can open a model by right clicking in the drawings model tree . .
Solved! Go to Solution.
Daryl,
my script was tested in D:\PTC\Open_Model_Drawing_AutoIt directory, if it is possible, create the same path on your disk. If you decide to use different path, then you have to change the path inside my macro.
Martin Hanak
Daryl,
some time ago I created AutoIt script with requested functionality. It can be used in English version of Creo Parametric 2.0.
This script works when you follow these rules:
If you are in the same "situation", then I can upload my script.
Martin Hanak
That would be great, yes!
Oh and what would I do with an AutoIt file?
Daryl,
my script was tested in D:\PTC\Open_Model_Drawing_AutoIt directory, if it is possible, create the same path on your disk. If you decide to use different path, then you have to change the path inside my macro.
Martin Hanak
Perfect, thank you very much!
Martin I don't suppose you would be willing to share the AutoIt script itself? I had a look into it and it seems very interesting and something I would want to look into myself! As a little starter excercise for I was just thinking of looking at your script and making the reverse (part opens from drawing). I noticed that if you have a lot of items open in Creo, typing "dd" in this case is a quick way of setting the drawing you want to active, even when it's already open.
Many thanks!
Daryl,
I attached the source code. Comments are in Czech language.
Martin Hanak
My hero, thanks!
Daryl,
You know that if you just use File Open then hit enter it opens the active part of a drawing that you are in.
I do Kevin thanks. As I mentioned, I was just interested to see Martin's original code to play with as this type of thing would be useful in other situations. Cheers for the input.
I corrected the problem related to switching keyboard layouts. See attachment.
Hi Martin, and thanks for your help here !
I've follow your procedure for the Open_Model_Drawing script, and I can now launch it for the mapkey DD.
But nothing happend, Creo just open his file explorer...
I've yee your latest update, but it's no more an *.exe file, so I don'' know how to use it...
Hi,
unfortunately your description of the problem is not clear - I do not know what is going on on your PC.
Note no.1:
open_drawing_cr2 application uses keyboard shortcuts (click ALT key to see them) valid in English version of Creo.
Note no.2:
My Open_Model_Drawing_AutoIt_2018-05-11.zip file contains also open_drawing_cr2.au3 source code, you can use it to investigate application behaviour.
Hi Martin, all apologies, I'll try to be more clear next text.
All apolologies also because the picture I've send previously came from another "Open_Model_Drawing" solution (see here).
I've now update the *.exe file with the latest version you send (2018-05-11) and it works now ! Thanks for it !
Hi,
please read my replay from 2015-01-07 05:02 PM.
Hello Martin
we are using your exe since a couple of years and we very happy with it. It opens the related draawing but today come the question:
If you are in an assy is it possible to click on a part and to have the related drawing open from this selected part?
also if I activate a part in an assy can this open the related drawing of the activated part?
thanks for your answer
regards
Vero
Hi,
I uploaded Open_Model_Drawing_from_mt_AutoIt_2019-03-01.zip
mapkey d3 runs mapkey d1 and d2
mapkey d1 opens selected part in separate window
mapkey d2 runs application file
application
Testing on my computer was not 100% successful. There were problems with synchronization of individual steps. Unfortunatelly I was not able to solve this problem.
So ... test the new script and you will see 🙂
thanks,
very useful macro,
Thanks
Hi,
when you place files to C: drive, you have to modify d2 mapkey definition in config.pro.
Hello Martin
thanks again but unfortunatly this is not fully working for us , like for you.
but I founded a workarround
I have opened first, on a new session, a drawing, and saved the trail file in a text file (open_drawing.txt).
when I have an assembly opened, I founded then the way to extract from the trail file the part number of the last selected item (in the graphic windows or in the tree)
for axample
if I select a part in the graphic windows i need to find the last line in the trail file containing
!%CIShowing surface created by feature 5 (Creo Geometry), model xxxxxx.
if I select the part in the tree I will I have to find the last line containing
!xxxxxxx.PRT
if I select an assembly in the tree I will I have to find the last line containing
!xxxxxxx.ASM
using vbscript I am able to read this trail, find the last line whatever I select in the graphic windows or the tree, and than put this part number in the "open_drawing.txt"
so my mapkey now is in fact 2 mapkeys
the first one extract the part number xxxxxxx (last line containg !xxxxxxx.PRT or !xxxxxxx.ASM or !%CIShowing )
the second mapkey run the "play trail file" feature and call the "open_drawing.txt"
work like a charm!
We still use your mapkey to open the related drawing of the activate part, this will be maybe my next challenge to make this possible in vbapi (maybe) 🙂
thanks again
Regards
Hello Amethyst,
could you kindly share the mapkeys?
Thanks a lot
Best regards
Luca
Hi Martin,
i am trying to use this app with windows 11 and creo 5. but it seems broken and not able to use.
can you please check and suggest what could have gone wrong.
Thanks in advance,
Rahul
@rahulvish07 wrote:
Hi Martin,
i am trying to use this app with windows 11 and creo 5. but it seems broken and not able to use.
can you please check and suggest what could have gone wrong.
Thanks in advance,
Rahul
Hi,
I am sorry I cannot help you. I use Windows 10.
@rahulvish07 wrote:
Hi Martin,
i am trying to use this app with windows 11 and creo 5. but it seems broken and not able to use.
can you please check and suggest what could have gone wrong.
Thanks in advance,
Rahul
Hi,
I tested version packed in Open_Model_Drawing_AutoIt_2018-05-11.zip with Creo 5.0.4.0 successfully in Windows 10.
Thank you for replying.
I have done some updates in the windows and now it's working.
Thanks,
Rahul
We love your macro.
I edited the config pro so you can make an icon in your quickmenu's, using the ORIGINAL open_drawing_cr2 script.
If you run this macro by typing it, it will have the same effect as before but now additionally it will work on sub-assembly's, and parts.
If you are in an assembly and right-click a part or subassembly, then customize in the menu.
Then you can add the mapkey by searching.
I added the button to my quickmenu and customized the icon to the drawing icon.
We are using it for a year now and it works like a charm.
Just today i added an additional line, so it will also open if an assembly has a representation (it used to get stuck on the rep menu).
That's when i looked up this post again, so I'd like to share this with everyone.
Kind regards,
Hi Mr. Martin
I tried your .exe file it's working fine, it's really helpful to us. And can we use the same thing using search.pro. Because drawing and CAD models are stored in different locations.
Thanks in Advance,
Amir
could you please help me in it, i want to learn it
@kamleshjoshi wrote:
could you please help me in it, i want to learn it
Hi,
unfortunately I do not understand your question.
1.] in .au3 file you can find source code of an application
2.] use Google to get explanation of individual commands functionality
Hello Martin,
thanks for your very good application. It is very usefull!!!!
We tried on more PC and until a week ago it worked perfectly.
Now only on one PC the shortcut seems to start but it doesn't complete the opening of the drawing. What it can be? On the other PC as said it continues to work perfectly. The "windows updates" are the same and the PC are identic.
Thanks
Luca