Printpreparation -how to controle from vba

By making a macro recording I can figure out how to start, how to lock rotation, how to set scale and to point out placement coordinates!

But

How do I set the name of the PlotSheet model that is going to be created? and how to I set the name of the plot-template I want to use.?

Second. Are there somewhere an example showing how to put data into the textfields in the templet head ?

By looking in the list of keyins possible under printpreparation I can see more options than I can read in the Bentley Help file --are there somewhere some extra documentation about the PrintPrep system ?

Thanks

Erik Wirring

Parents
  • Erik,

    you can control the entire process of printprep output creation from an XML file passed to the application.

    How do I set the name of the PlotSheet model that is going to be created?

    The name of the created sheet model is always generated and can not be set upfront (rename after creation?). We use the naming pattern "PrintPrepOutput-##".

    and how to I set the name of the plot-template I want to use.?

    You can start the interactive mode with the keyin

    printpreparation workflow runwizard <PathToTemplatefile>\<TemplateModelName>

    Using the XML configuration file

    For all automation that does not require user input, you can better use the XML configuration file to drive print preparation. The file contains all information about the "printprep viewports" and "printprep text placeholders". Quickest approach is to create a file from existing printprep output with the keyin:

    printprep writexmlconfig

    The message center states the location of the created file. Use this file as the basis for your automation and modify the contents. Change the mode for text placeholders to "4" and pass the text you want to display in the attribute "arg". See the example below.

    <?xml version="1.0" encoding="UTF-8"?>
    <framecfg>
        <info>
            <version>1</version>
        </info>
        <options>
            <!-- batchmode activates processing the template without any user interaction -->
            <!-- 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>

    Your configuration is used to "override" the existing known settings. So you can strip all information from XML configuration you do not want to modify. To start printpreparation and let it create your output from the active model send this keyin:

    printpreparation workflow runbatch <PathToXmlConfigurationFile>

    To create PDF output along with the output model put an XML-Element inside the <files> section

    <pdffile>YourOutputFullPath</pdffile>

    Hope that helps

    Stephan

  • Hello Stephan,

    When I use "printprep writexmlconfig" key-in in a vba program, in the result xml shows that area mode set "1". Before I send this key-in could I set somewhere this mode to "8"? I would like to save the masterfile coordinates instead of sheet model coords. Or have you got any other solution of this problem?

    Thank in advance,
    Angela
Reply Children
No Data