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

Creo 2.0 - Open a drawing from active part?

SOLVED
Highlighted
Newbie

Creo 2.0 - Open a drawing from active part?

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 . .

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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.

  1. save open_drawing_cr2.exe into D:\PTC\Open_Model_Drawing_AutoIt
  2. open my config.pro and copy the line into your config.pro (you can see the above mentioned path inside the mapkey)
  3. restart Creo 2.0
  4. open part
  5. typ dd to run my macro

Martin Hanak


Martin Hanák

View solution in original post

24 REPLIES 24
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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:

  1. model name = drawing name
  2. drawing file is saved in current working directory -OR- in the directory specified in SEARCH_PATH option

If you are in the same "situation", then I can upload my script.

Martin Hanak


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

That would be great, yes!

Oh and what would I do with an AutoIt file?

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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.

  1. save open_drawing_cr2.exe into D:\PTC\Open_Model_Drawing_AutoIt
  2. open my config.pro and copy the line into your config.pro (you can see the above mentioned path inside the mapkey)
  3. restart Creo 2.0
  4. open part
  5. typ dd to run my macro

Martin Hanak


Martin Hanák

View solution in original post

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Perfect, thank you very much!

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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!

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Daryl,

I attached the source code. Comments are in Czech language.

Martin Hanak


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

My hero, thanks!

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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.

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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.

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

I corrected the problem related to switching keyboard layouts. See attachment.


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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...Smiley Frustrated

I've yee your latest update, but it's no more an *.exe file, so I don'' know how to use it...dd.JPG

-----------------------------------
Pierre, expert on Solidworks ... losted on Creo
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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.

 


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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 ! Smiley Happy

-----------------------------------
Pierre, expert on Solidworks ... losted on Creo
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Hi,

 

please read my replay from ‎2015-01-07 05:02 PM.


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Hi,

I uploaded Open_Model_Drawing_from_mt_AutoIt_2019-03-01.zip

  • unzip the file
  • move Open_Model_Drawing_from_mt_AutoIt directory into D:\PTC
  • my config.pro contains 3 mapkeys ... place them into your config.pro
  • launch Creo
  • select part in model tree
  • type d3 and hope that your computer is quick enough

mapkey d3 runs mapkey d1 and d2

 

mapkey d1 opens selected part in separate window

 

mapkey d2 runs application file

application

  • takes name of the part
  • closes part's window
  • opens drawing of selected part

 

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 🙂


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

thanks,

 

very useful macro,

 

Thanks

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Hi,

when you place files to C: drive, you have to modify d2 mapkey definition in config.pro.


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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

 

 

Highlighted

Re: Creo 2.0 - Open a drawing from active part?

could you please help me in it, i want to learn it

Highlighted

Re: Creo 2.0 - Open a drawing from active part?


@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


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

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

Highlighted

Re: Creo 2.0 - Open a drawing from active part?


@ptc-3260121 wrote:

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


Hi,

unfortunately I am not able to guess what is going on on one specific PC.

Simply said there must be some difference ...

You can do following steps to reproduce application functionality:

  • press ALT+F on keyboard to open File menu
  • press O on keyboard to open File Open dialog box
  • in File Name field > type model name + .drw (for example cube.drw if cube.prt is displayed in Creo window)
  • click Open button

 


Martin Hanák
Highlighted

Re: Creo 2.0 - Open a drawing from active part?

Hi,

I have a question for this ? Can I use it with Windchill 10.2 ?

I understand that it work with local or network drives, but we would like to use it on Windchill workspace.

Can we do it ?

Thanks

Sandor Papik

Announcements