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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

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

bduncan
16-Pearl

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

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.

ACCEPTED SOLUTION

Accepted Solutions
Jose_Costa
6-Contributor
(To:bduncan)

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

View solution in original post

20 REPLIES 20
Nico1
1-Newbie
(To:bduncan)

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

bduncan
16-Pearl
(To:Nico1)

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

you can use Python for scripting in Creo?

athomasen
5-Regular Member
(To:Nico1)

Can you please share the "small" python script?

Jose_Costa
6-Contributor
(To:bduncan)

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

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

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


Martin Hanák

Thank you for providing this detailed steps, But I can not get the correct way.

1.jpg2.jpg3.jpg123456789.gif

Hi,

my config.pro contains this option (note a semicolon at the end of the line):

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

I created and uploaded a video showing my test...

Martin Hanak


Martin Hanák
Gucio
14-Alexandrite
(To:Jose_Costa)

This script works great untill "force_new_file_options_dialog" is setup to YES. Is someone able to add some lines of code, which omits this issue?

Krzysztof Urbaniak

Krzysztof
Jose_Costa
6-Contributor
(To:Gucio)

Hi,

Try this one : https://www.dropbox.com/s/0ajg8i18u3po3sl/new_drw%201.zip

I included a 64 bits version too, try both.

Jose

Hi Jose,

Is this still available?  I get the following error message when using the dropbox link:

Error: 429

Error (429)

This account's links are generating too much traffic and have been temporarily disabled!



Hi,

attached you can find tool published on


Martin Hanák

Hi Martin,

 

First, your stuff is fantastic. Is there anyway to get this automatic drawing creation script to accept the default template automatically?

Jose_Costa
6-Contributor
(To:bduncan)

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

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

Jose_Costa
6-Contributor
(To:bduncan)

I´m glad you could make it Duncan.

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

José

Chinese version.Do you have difficulty with it?

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags