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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

distributed bach problem

jasiek
1-Newbie

distributed bach problem

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


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.
1 ACCEPTED SOLUTION

Accepted Solutions

Pawel,

what about this ...

  • turn off your config.pro modification ... pro_editor_command "cscript c:\script.vbs"
  • open model (eg. prt0001.prt)
  • Program > Edit Design
  • do nothing in Notepad and click File > Exit
  • Answer NO to question Do you want to incorporate your changes into the model?
  • now you can find prt0001.pls file in working directory
  • modify prt0001.pls using your script.vbs
  • Program > Edit Design > From File > prt0001.pls
  • Answer YES to question Do you want to incorporate your changes into the model?

I can continue tomorrow. Please send me your script, if it is possible.

Martin Hanak


Martin Hanák

View solution in original post

4 REPLIES 4

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":

  • trail header
  • file opening
  • pro/program modification
  • file save
  • file erase from session
  • creo exit

Step 4.]

Generate new batch_trail.txt file containing:

  • trail header
  • file no.1 opening (set file no.1 name in this section)
  • pro/program modification
  • file save
  • file erase from session
  • file no.2 opening (set file no.2 name in this section)
  • pro/program modification
  • file save
  • file erase from session
  • ... and so on

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


Martin Hanák

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

  • turn off your config.pro modification ... pro_editor_command "cscript c:\script.vbs"
  • open model (eg. prt0001.prt)
  • Program > Edit Design
  • do nothing in Notepad and click File > Exit
  • Answer NO to question Do you want to incorporate your changes into the model?
  • now you can find prt0001.pls file in working directory
  • modify prt0001.pls using your script.vbs
  • Program > Edit Design > From File > prt0001.pls
  • Answer YES to question Do you want to incorporate your changes into the model?

I can continue tomorrow. Please send me your script, if it is possible.

Martin Hanak


Martin Hanák

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

Top Tags