Skip to main content
14-Alexandrite
September 23, 2014
Question

Automation help

  • September 23, 2014
  • 2 replies
  • 2230 views

I'm currently running Pro/E WF4.0 and I need some help trying to automate a batch process. Due to various reasons, I'm forbidden from using J-Link, WebLink, or the VB API so I need to get it all working with trail files and/or mapkeys.

Here is a quick run down of what my batch process does/should do:

1. Calls a Python script to generate a file selection dialog where the user can pick multiple drawings (working 100%).

2. Generates a Trail file using the file list in step 1 (sort of working).

3. Runs the trail Trail file to automate the whole process for the user (completely broken because of mapkey).

The main problem that I'm having is that step 2 needs to call a mapkey that has a pause for the user to modify a parameter and it breaks the whole trail file. Basically, it will open the first file and run the mapkey but after that it just opens the files without the mapkey.

I tried another approach to this problem by generating a mapkey file rather than a trail file which works, but I'm afraid that loading/unloading the mapkey can cause some problems.

Anyone have any tips/pointers on how to get the trail file to work with mapkeys or should I just go the mapkey file route?


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.

2 replies

1-Visitor
September 23, 2014

Try the .txa suffix and training file directives.

http://help.ptc.com/creo_hc/creo30_pma_hc/usascii/index.html#page/pma/fundamentals/fund_two_sub/Directives_for_Creating_Training_Files_and_Train.html

I think trail files cannot have mapkeys; unless it is changed trail files record the results of actions rather than the causes so using a mapkey to do something ends up with a record of the steps the mapkey performed, not just the characters typed to start the mapkey.

Training files, on the other hand are more flexible; they have functions to allow users to start and stop activities at predefined points. Adding the parameter step should be easy.

Mapkeys can include other mapkeys as a pre-processed step to being executed.

12-Amethyst
September 23, 2014

In think that if you need a pause / user input, you have to do it with mapkeys.

From what I know trailfiles don´t allow pauses. Even training files are very limited. They have a command

`user_input

But this command forces the user to enter a specific text, not the text you want.

I understand your concern loading the mapkeys into session. Maybe restarting Creo in the end be a good practice?

Jose

1-Visitor
September 23, 2014

Syntax

`pause line number

Description

Stops the execution of the training file until you click Resume to continue the execution of the training file again.

Example

`pause 74

I presume one could do whatever you want during the pause.

I don't understand the concern TractorGuy has with loading mapkeys. They are just text.

The training files offer a little more in the way of letting the user know what's going on and can shut off graphics and turn them back on to go a little faster.

This is an interesting bit about Mapkeys.

I'd explain, but that's just a complete copy.paste, so ...

http://help.ptc.com/creo_hc/creo30_pma_hc/usascii/index.html#page/pma/fundamentals/fund_five_sub/About_an_Incremental_Mapkey.html

I don't know if it is only CP3 or if it has been there a while..

12-Amethyst
September 24, 2014

No, from what I remember, It only allows "continue" or "quit", and Creo is "freeze" until you click a option, you can´t interact with it.

Jose