Skip to main content
17-Peridot
November 27, 2013
Solved

How to get current model name when I create a Drawing?

  • November 27, 2013
  • 4 replies
  • 13076 views

HI

For example,When I create a Part named "PTC_ER_123",QQ%E5%9B%BE%E7%89%8720131127135754.jpgnext I will create a Drawing,And I want to reuse part name,that means drawing name is named "PTC_ER_123",Is that PossibleQQ%E5%9B%BE%E7%89%8720131127140836.jpg

Thanks a lot.

Best answer by Jose_Costa

I´ve done a small script for that too. It´s made with Autoit and it´s for Creo 2.0:

https://www.dropbox.com/s/iri3b7bbiuj3rqh/new_drw.zip

All you have to do is execute it with Creo open or create a mapkey, something like:

mapkey drw @SYSTEMc:\\creo-macros\\new_drw.exe ;

I´ve included the source code too. Good luck.

Jose

4 replies

1-Visitor
November 27, 2013

Not with normal tools. Just with customizations. I use a little Python-Script to do that.

bduncan17-PeridotAuthor
17-Peridot
November 27, 2013

Thank you very much for your quick response,It seems that I must deal with it artificial.

12-Amethyst
November 27, 2013

I´ve done a small script for that too. It´s made with Autoit and it´s for Creo 2.0:

https://www.dropbox.com/s/iri3b7bbiuj3rqh/new_drw.zip

All you have to do is execute it with Creo open or create a mapkey, something like:

mapkey drw @SYSTEMc:\\creo-macros\\new_drw.exe ;

I´ve included the source code too. Good luck.

Jose

bduncan17-PeridotAuthor
17-Peridot
November 28, 2013

Thank you very much,But I have no idea to do this. Will you show me with a video

24-Ruby III
November 28, 2013

Hi,

try following procedure (I tested it on Windows XP 32bit with CR2 M080):

1.] download new_drw.zip into c:\creo-macros directory (or your own specific directory)

2.] unzip new_drw.zip (c:\creo-macros directory contains new_drw.exe file)

3.] add the following mapkey into your config.pro file

mapkey drw @SYSTEMstart c:\\creo-macros\\new_drw.exe;

4.] launch Creo Parametric 2.0

5.] open part

6.] type drw and you will see the effect of AutoIt script

Martin Hanak

12-Amethyst
November 29, 2013

Hi,

That is strange, I have that script working on several computers and I no problems until now.

I noticed you have a mapkey for each letter: "a" "b" "c"...

Do you have any called "d" or "dr"? If you have, that may be the problem, because when you´re trying to call mapkey "drw" you first call mapkey "d", and you will never be able to call the "drw".

I watched your animation and when you are trying to call mapkey "drw" in the status bar it only appears the letter "d". So it seems that Creo executes something else before you fully type "drw".

What Martin said is also true, you missed the semicolon at the end of the line, that´s enough for the mapkey to fail.

Another suggestion:

1 - Start Creo

2 - Open a part

3 - Launch Windows explorer and open folder C:\creo-macros

4 - Double click on new_drw.exe

Now, what has hapenned?

If nothing, then something in your computer may be blocking that script (antivirus, firewall?).

If it has worked than the problem is not on the script but in Creo.

I hope you can get it work.

Jose

bduncan17-PeridotAuthor
17-Peridot
December 5, 2013

YES, IT WORKS OK! I uninstall the firewall Thanks a lot.

12-Amethyst
December 5, 2013

I´m glad you could make it Duncan.

By the way, what program have you used to make that animated gif ?

José

bduncan17-PeridotAuthor
17-Peridot
December 6, 2013

Chinese version.Do you have difficulty with it?