Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi folks,
I have tedious assignment of removing pro/program INPUT parameters (all lines betwee INPUT and ENDINPUT commands in pro/program). In order to make this process easier I created simple vbs script which removes this redundant lines automatically. Then I've changed pro_editor_command option to "cscript c:\script.vbs" so when I choose Pro/Program -> Edit Design it returns cleaned pro/program. Next I recorded mapkey:
mapkey pp ~ Activate `main_dlg_cur`;\
mapkey(continued) ~ Command `ProCmdMmProgram`;\
mapkey(continued) #EDIT DESIGN;Yes;#DONE/RETURN;\
mapkey(continued) ~ Command `ProCmdModelSave` ;~ Activate `file_saveas` `OK`;
so far so good.
But when I run this mapkey from Creo Distributed Batch it just isn't working (CDB stays on "working" mode - I waited 2 hours and still the same). What am I doing wrong? Or mayby someone have another idea how to deal with such task.
Thanks in advance
Pawel
Solved! Go to Solution.
Pawel,
what about this ...
I can continue tomorrow. Please send me your script, if it is possible.
Martin Hanak
Pawel,
I guess that you want to remove pro/program INPUT parameters in long list of models ...
My suggestion is ... try to use trail file.
Step 1.]
Launch Creo and remove pro/program INPUT parameters from one model. Then exit Creo.
Step 2.]
Rename trail.txt.n to my_trail.txt
Step 3.]
Open my_trail.txt in text editor. From your point of view this file must have following "sections":
Step 4.]
Generate new batch_trail.txt file containing:
In the past I used BASIC programming language to read list of files and generate trail file.
Step 5.]
Launch Creo and play batch_trail.txt.
Good luck
Martin Hanak
Hi Martin,
I tried with trail file. With pro_editor_command option set to "cscript c:\script.vbs" I tested simple trail (test.txt) file as follow:
!trail file version No. 1600
~ Activate `main_dlg_cur` `main_dlg_cur`
~ Command `ProCmdModelOpen`
~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` \
`file_open`
~ Update `file_open` `Inputname` `somefilename.prt`
~ Activate `file_open` `Open`
~ Command `ProCmdMmProgram`
#EDIT DESIGN
to this moment it works well - #EDIT DESIGN executes aforementioned script. But when I added next commands (to accept changes):
!trail file version No. 1600
~ Activate `main_dlg_cur` `main_dlg_cur`
~ Command `ProCmdModelOpen`
~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` \
`file_open`
~ Update `file_open` `Inputname` `somefilename.prt`
~ Activate `file_open` `Open`
~ Command `ProCmdMmProgram`
#EDIT DESIGN
!%CPDo you want to incorporate your changes into the model? [Yes]
YES!
#DONE/RETURN
it's not processing pro/program file. It looks like command #EDIT DESIGN don't run my script when some code is after this command. What I have also noticed after Pro/Program -> EDIT DESIGN for a moment is visible DOS window (from cscript probably) but in the second case (with additional commands) it didi't occur. I also tried running the trail file step-by-step, but with the same result. Then I changed trail_delay option from 0 to 3 sec - also failure.
Do someone know solution to this problem?
thanks in advance
Pawel
Pawel,
what about this ...
I can continue tomorrow. Please send me your script, if it is possible.
Martin Hanak
Thank you. Your procedute is working. Now I only must integrate this to bat file with 3 steps like this:
step 1st: launch creo with trail1.txt
step 2nd: modify .pls file
step 3rd: launch creo with trail2.txt
Thank you once again.
Pawel