Doug I am trying to create a file open then run a mapkey from a batch file. When I do this I get a ton of extra stuff, not sure what I can delete and what I cant. Any suggestions?
This is a very old post - note the original is dated 2008.
That said, I'm still using this same method, and likely the same trail file.
I created the trail file by starting a new session and typing the mapkey I want to run. That's it, don't close Creo or do anything else. Go to your trail file folder and find that trail file and copy it. Then, you need this line in your batch file to run the trail file when you start Creo:
start "" "path/to/parametric.exe" path/to/trail/file
I hope that helps.
this may not answer your question but it may give you some insight...
I got this from Niko Pintar, either here or on MCAD central, figured it out and applied it to my environment
What this does is creates a new drawing, when the model is open, with a mapkey
mapkey "std" starts the process of creating a new drawing then the bat file creates a tiff image (to grab the name) then writes the name to a file.
another bat file is started (within "std") where the filename is picked up and a mapkey script "usdrw" is written to a .pro text file, now containing the new name.
Further into the "std" mapkey, the new .pro file is read in, now defining "usdrw" in the current session.
at the end of "std" mapkey, the newly defined "usdrw" mapkey is now initiated.
perhaps you can edit it to what you are looking to do,
good luck and hope it helps
Well it is interesting. But what I would like to do is
run a trail file (with a defined part number, that I can change in trail file), then run a mapkey that generates mass and saves the model
call "C:\PTC\Creo2_M070\Creo 2.0\Parametric\bin\parametric.bat" "D:\tmp\creo\my_trail.txt" -g:no_graphics
Well, to be honest, I can't invest the time to create scripts to solve the challenge you have.
hopefully, I provided an answer and perhaps more to your initial question of how to run/initiate/write a file with a mapkey.