~ In progress
For all automation that does not require user input, you can control the entire process of Print Preparation output from an XML configuration file passed to the application. The file contains all information about the printprep viewports and printprep text placeholders. The quickest approach is to create a file from an existing output model created by the printprep application. To do this, use the key-in: printprep writexmlconfig
In this example, the file ...\PrintPrep@PrintPrepOutput.xml is create which can be used as the basis for your automation by modifying the contents.
<?xml version="1.0" encoding="UTF-8"?> <framecfg> <info> <version>1</version> </info> <options> <!-- batchmode activates processing the template without any user interaction --> <!-- Note that it turns off editing for text placeholders --> <batchmode>1</batchmode> </options> <files> <!-- use this file as template. The filename may contain environment variables --> <seedmodel>$(MY_TEMPLATE_PATH)MyTemplates.dgnlib\MyModelName</seedmodel> </files> <texts> <!-- list all text placeholders you want to configure differently. E.g. change the environment variable that should display as text content --> <text key="6" editable="1" mode="1" guid="851b268b-076d-411f-9c6a-7a1fbf5781c5" arg="MS_GEOPRINTPREP_DGNLIB"/> <!-- or provide the text content in arg while setting mode to 4 --> <text key="3" editable="1" mode="4" arg="My Text Override" /> <!-- original node content when saving with keyin FRAMELIB WRITEXMLCONFIG MS_PRINTPREP_APITEST --> <!-- text key="15" editable="0" mode="1" guid="851b268b-076d-411f-9c6a-7a1fbf5781c5" arg="_DGNFILE"/--> <text key="15" editable="0" mode="4" arg="This was the placeholder for variable _DGNFILE"/> </texts> <areas> <!-- to predefine the area which is displayed as viewport content for viewport with key=1, set the mode to 8 and specify scale, rotation and origin in masterfile coordinates --> <area key="1" name="Rahmen" mode="8" scale="3456.000000" rotation="30.000000" > <origin x="-751.67" y="550.82" /> </area> </areas> </framecfg>
This configuration file is used to override the existing settings. You can therefore strip all information from XML configuration that you do not want to modify. To start print preparation and create your output model from the active model, use this key-in:
printpreparation workflow runbatch <PathToXmlConfigurationFile>
To create PDF output along with the output model put an XML-Element inside the <files> section
<pdffile>YourOutputFullPath</pdffile>