The task could beacomplished byusing a trail file and some type of batch or script file. The trick is to exit out of pro/program text editor in order to return control back to pro/e which isrunning trail file sequence.
-change config.pro settings for Pro/Program editor to be a plain text editor ("notepad.exe" for example).
-output a pro/program file by usingTools->Program->Edit Design command sequences. This will spawn a text editor process.The pro/program file will have themodel name and '.pls' extension. It is aplain text file. Replace this file with the good one.
-kill running text editor process ( taskkill.exe on windows) thus returning control back to proe.
-Pro/E will continue the trail file sequence with 'Current values' option.
-use Regenerate->Current Values as the final check.
-exit pro/e and start pro/e for the next model.
In Reply to Lyle Beidler:
We have a bunch of models that all need to have their Pro/PROGRAMS modified.
This will all be pretty similar stuff, and it may be worth my while writing
a JLink program to automate modifying the Pro/PROGRAM (yes, I know it sounds
silly. It's a long story). Have any of you JLink masters done anything
like that? Do you have any tips or code you'd be willing to share? Bad
idea? Good idea? Impossible to do? Any feedback is welcome. Thanks!
178 Muddy Creek Church Rd
Denver PA 17517
The best way to edit and change the Pro/Program file is to perform an JLink ProgramExportInstructions then change the exported file by reading the lines using the java.util package. After successfully changing the Pro/Program file, then you will perform a JLink ProgramImportInstructions. If you are wanting to change only the relations then you can use the model.GetRelations and model.SetReleations. If you want to set the post relations then you would need to export the program because there is not a post relations method. This is the best way to modify a Pro/Program file.