Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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?
Try the .txa suffix and training file directives.
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.
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 ...
I don't know if it is only CP3 or if it has been there a while..
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
These are the options
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.