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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Automation help

TractorGuy
12-Amethyst

Automation help

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.
6 REPLIES 6

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.

Jose_Costa
6-Contributor
(To:TractorGuy)

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

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..

Jose_Costa
6-Contributor
(To:dschenken)

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

Jose_Costa
6-Contributor
(To:Jose_Costa)

These are the options

Single+Step+Trail_2014-09-24_01-05-17.png

Of course, why would that behavior be in the Help file? Last time I used them it was in conjunction with Excel to create files to create drawings; I liked the txa suffix/training file because any errors in execution don't crash out like trail files do.

It doesn't look like the pause syntax is documented for mapkeys in the Help files.

Top Tags