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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

ProE and AutoIt

DARYLREECE
7-Bedrock

ProE and AutoIt

Has anyone used AutoIt (a simple scripting language) to automate ProE tasks? I want to write a batch drawing creator/uploader and my problem is I can't figure out how to determine when ProE is ready for the next command. Sometimes, for network or other reasons, a drawing might take 2 seconds to open and then others, it might take 10. I need a green light from ProE to continue. Any ideas?


Best regards, Mit freundlichen Grüßen, Meilleures salutations,
[Signature.tif]
Daryl S. Reece
Engineer
Alcon Labs
11460 Johns Creek Parkway
Johns Creek, GA 30097
USA
Phone: +1 678 4154223
Email : daryl.reece@alcon.com<">mailto:daryl.reece@alcon.com>




This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

I've been working on something similar (also written in Autoit). I'm using
a couple of techniques in order for the script to "know" what Creo
Parametric is doing.

1. I've pre-recorded my Creo Parametric interaction into mapkeys. As the
last step of each mapkey, I open the the system information dialog (File >
Help > System Information). This automatically creates a file in the start
up directory named "support.inf.1". So I have my script wait for that file
to be created...and I know that the mapkey has completed. Then I delete the
file and continue on.

2. At times I also read the trail file. I read each new line as it is
created and attempt to match a given string with the text in the file. So
for instance I look for "Checkout and add to workspace succeeded" to
confirm that a particular model has been check out.

I'm sure there are better techniques out there but this is working for me.


Mike Phillips
Raytheon



I like the System Information file technique and definitely find using mapkeys via AutoIt advantageous.


One thing I have found unreliable is looking for existence of windows. One would think that a window would not exist until it was opened, but not so. Often applications create windows and give them negative locations or zero size. A 'wait until win exists' will return instantly, even though the target not visible to the user and was never active. Preferable to try Winactivate and see if it did.


Using System Date and Time is also useful as an item to find in the Trail file. Not only does it report the current date/time, it also reports how long it was since the last use of the command. This delta is not reported to the message area (to WF5)


Dave S.



In Reply to Mike Phillips:


I've been working on something similar (also written in Autoit). I'm using
a couple of techniques in order for the script to "know" what Creo
Parametric is doing.

1. I've pre-recorded my Creo Parametric interaction into mapkeys. As the
last step of each mapkey, I open the the system information dialog (File >
Help > System Information). This automatically creates a file in the start
up directory named "support.inf.1". So I have my script wait for that file
to be created...and I know that the mapkey has completed. Then I delete the
file and continue on.

2. At times I also read the trail file. I read each new line as it is
created and attempt to match a given string with the text in the file. So
for instance I look for "Checkout and add to workspace succeeded" to
confirm that a particular model has been check out.

I'm sure there are better techniques out there but this is working for me.


Mike Phillips
Raytheon



mkorch
14-Alexandrite
(To:DARYLREECE)



The title bar changes as the Pro/E object is loading. During loading it
will be something like "object (Active) - Pro/ENGINEER".

Script example:

$objectname = "OBJ_123456" ; Proe object name without the extension

; < code goes here to open the object in Pro >

WinWait ($objectname & " (Active) - Pro/ENGINEER") ; Autoit waits here
until object is finished loading
WinWaitNotActive ( $objectname & " (Active) - Pro/ENGINEER") ; not
necessary -- just checks Pro is done loading the object
MsgBox (48,"Carry On","Done Loading") ; object is loaded, carry on

-Jim

Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags