Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Programming for ProE Automation 1

Status
Not open for further replies.

SVandal

Mechanical
Aug 19, 2008
3
0
0
US
I am currently using Wildfire 3.0 and may be moving to 4.0 soon. I am trying ot find a way to automate some tasks in ProE, specifically relating to CATIA file conversions, and in general to creating parts, drawings, etc. Are there any reference materials out there that deal with running ProE from a batch file or with the command tree for ProE. I have been searching for a while and haven't found anything that fits the bill. I would appreciate any help that can be given.
Thanks,
SV
 
Replies continue below

Recommended for you

I'm not sure if this will help, but Pro/E does have a mode called Pro/Batch which allows for batch plotting and file conversions (from Pro/E to other formats, however, and not the other way around). I haven't worked with it in years, so I'm not sure what WF3 or WF4 can do, or if there have been improvements to this utility (I remember it being a PITA back then).

Some have managed to automate some tasks in Pro/E by making use of Trail Files. These trail files can be loaded from the command line, which might be what you are looking for. The "automation" that I've heard of involved using Visual Basic or some similar programming language to create a program that generates a trail file based on user inputs, then the trail file is saved to a specific location, and the VB program then loads up Pro/E with the trail file.

This is the closest thing to a command-line based execution in Pro/E, without getting into Pro/Toolkit (C++ based) solutions.



 
There are many ways to automate Pro/Engineer activities. Mapkeys and trail files work great when you know the sequence of actions within the GUI and need to repeat those same steps. They provide no if-then-else type of construct and as a result are not really programming languages.

For information on adapting trail files, you can refer to my series of articles starting with:
[URL unfurl="true"]http://inversionconsulting.blogspot.com/2008/05/proe-anatomy-of-trail-file-part-1.html[/url]


Another option is to use Javascript or VBScript in the Pro/Engineer embedded web browser via PFC based Pro/WebLink. This provides a lot of programmable access into the Pro/Engineer session and models, is very easy to use, and quick to program. Because it works in the web browser, there are some security hassles to deal with, but that's a one time initial problem. You should have a "weblink" folder in your Pro/Engineer install that contains examples and documentation.

Beyond the online help, here are some starting points for Pro/WebLink:
[URL unfurl="true"]http://inversionconsulting.blogspot.com/2008/04/weblink-what-is-it-anyway.html[/url]
[URL unfurl="true"]http://inversionconsulting.blogspot.com/2008/07/proe-weblink-getting-started-tips.html[/url]


PTC released the VB API for use with Wildfire 4 and higher. This is also a PFC based API, which means it has mostly the same core (but more) functionality as Pro/WebLink. You can use just about any flavor of VB (or practically any scripting language) desired with the VB API.

Some starting points for VB API:
[URL unfurl="true"]http://inversionconsulting.blogspot.com/2008/06/proe-visual-basic-api-first-look.html[/url]
[URL unfurl="true"]http://inversionconsulting.blogspot.com/2008/06/proe-vb-api-not-just-for-visual-basic.html[/url]


J-Link (also PFC based) is for automating Pro/Engineer in Java. Documentation and examples can be found in the "jlink" folder in your Pro/Engineer install.

Here is a Pro/Files articles on J-Link:
[URL unfurl="true"]http://www.profilesmagazine.com/p39/felkins.html[/url]


Pro/Toolkit is the C/C++ based API. It requires considerably more investment in time and money to start producing useful applications, but it is very powerful. It differs from the all other methods that I have mentioned in that it is not free. While the PFC API's allow access into Pro/Engineer, including the ability to manipulate models, creating models and geometry is either not possible or just very difficult. Pro/Toolkit allows you to create stuff, but it is also not particularly easy either.


I hope that gives you a sense of what your options are.


Marc

--
Marc Mettes
Inversion Consulting
 
Is there a list of trail file commands or something similar that lists all of the commands that can be executed through the trail file? I am starting to think that a macro in excel could be created that would create the trail files that I need and then could call out the trail files to be run using a batch file.

I just have a lot of CATIA files to convert and this would make life a lot better.
Thanks,
SV
 
I believe the best way to go about it is to load up pro/e, perform all of the actions that you want it to do in a single run, and then interrogate the trail file.

The sites listed above by marcmettes offer some really good tips on how to do this.
 
I tried to use a trail file modified by and Excel for a side job a couple of years ago. I found that the trail file would not work as the computers were different. I had to have the client redo the the commands on their computer to create the initial trail file. Not the best way to automate Pro/E

Peter Stockhausen
Pollak Switching Products
 
Well, it looks like I am back to learning how to program in Java. I am going through the Jlink examples to see if I can get this process to automate. It takes too much time to go through everything as it takes up my computer so I end up with hours of watching the numbers fly by.

Marc,
Thanks for the links, I had found your blog on a search, but that is a good list of ones that I had not looked at yet.

Thanks again to everyone for the help.

SV
 
Trail files can be very tricky, but they can make your
organization hugely productive. They have to be created
and edited very carefully to ensure robust results from
model to model and system to system. I stick to clicks
in menus and dialogs only, never in the graphics window,
for my trail files.

I have anywhere from 30-40 computer-hours of automation
running per day using trail files. When the models are
good and the servers are up, they work flawlessly. Dozens
of users would be wasting enormous amounts of time if not
for trail files.


Marc


--
Marc Mettes
Inversion Consulting
 
Status
Not open for further replies.
Back
Top