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