Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi,
I´m in the middle of generating PDF files of drawings. The drw files have a number as a name. When generating PDFs in the batch process I would like to append the value of a model parameter to the PDF filename for instance: 12345_ExamplePart.pdf where the orange part is the name of the drw-file and the green part represents the value of the parameter.
Is this possible?
Thanks in advance
Hi,
I do not believe that Distributed Batch can be configured to follow your wish.
As Martin stated, distributed batch cannot do this out-of-the box.
However, I believe there are several methods to get this done.
1. You can rename the files after the PDF's have been created. If you have Windchill, you can easily generate a list (table) that shows the filename & parameter values (assuming the parameter is designated). You can then export that list (table) to a .txt or .csv file for use in a simple OS script to rename the files. This is probably the easiest method.
2. If you don't have Windchill or the parameter is not designated for Windchill to see it, you may still be able to extract the filename/parameter values to a file. Distributed batch will allow you to run a task called "Run a mapkey defined in a config.pro". If the mapkey exports the parameters to a .txt file, the exported filename is in the format of drawingfilename_par.txt. I'm assuming the parameter you want is a drawing parameter. If so, the mapkey isn't that complicated. In the Parameters dialog, FILE > EXPORT > IN .TXT FORMAT. If you want to export a model parameter, things get more complicated, but I believe still possible. You can now extract the parameter from the drawingfilename_par.txt files to generate your rename .txt or .csv file.
3. Distributed batch can also run a task called "ModelCheck". If you setup modelcheck to just report the parameter value you want, you now have report files, in the mc_reports area, with the filename and parameter. You can then use those files to generate your rename .txt or .csv file.
In methods 2 & 3 above, you can use the same object list in Distributed batch to export the PDF files and run the other modelcheck or mapkey task.
Regards,
Dan N.
I'm not at all familiar with Distributed Batch, but I use mapkeys and batch files to append the contents of our REV parameter to exported files. It involves exporting a text file of parameters and values, reading that file to extract the contents of the REV parameter and then renaming the output file to include the REV parameter.
As Dan mentioned, the trick is getting model parameters exported from a drawing. You have to take into account parts vs. assemblies and multimodel drawings. It's a bit tricky, but doable. Once you get mapkeys and batch files set up to do the work, there may be a way to integrate that into Distributed Batch.
Thank you Doug and Dan. Can you recommend any tutorials or documents I should read for working out a solution with Batch Scripts and mapkeys?
Can you please tell me how you use mapkeys and batch files to append the contents of REV parameter to exported file?
@sparulekar wrote:
Can you please tell me how you use mapkeys and batch files to append the contents of REV parameter to exported file?
I'm no longer in the Creo world and don't have the files handy anymore, but I can give you the top level gist of it. I used a series of nested mapkeys to do all the work. One mapkey calls a batch file and then another series of mapkeys and at the end it calls another batch file.
I think that's how it was done, as I've said I've been away from it for some time. If you search here, I'm pretty sure that I described the process in more detail, including some code snippets, somewhere. Others have done similar things and have published their methods as well.
Good luck.
Thank you so much. I will try it out