Running the Examples

To run the imodelVisitor example:

  1. Confirm the application has been built (see Building the Examples).
  2. Go to Utilities > MDL Applications, click the Browse pushbutton, navigate to the folder containing the application, select the application, and click Open.
  3. When the application is loaded, its commands can be reviewed through Utilities > Key-in by entering IMODELVISITOR.
    1. To report the schema, use the command IMODELVISITOR ACTION REPORT. This outputs an XML file that contains the definition of all the schema present in the file.
    2. To report the graphics and data in the file, use the command IMODELVISITOR ACTION PROCESS with * as the unparsed parameter. If you want a specific schema name and version number, that can optionally be passed to filter the data extracted from the file. This outputs two XML files that can be viewed. Both are named Sample.xml to the MS_DATA directory using the name (user should change the file name)
    3. To set the PROCESS comand to output all schema use the command IMODELVISITOR SET PROCALL with ALL as the unparsed argument.
    4. To add a schema to the file, use the command IMODLEVISITOR ACTION ADDSCHEMA with the full path to schema's XML file.
    5. To set the publish options, use the command IMODELVISITOR SET PUBOPTS with the appropriate argument(s), which are listed in the comments for the function in the source code.
    6. To set the package options, use the command IMODELVISITOR SET PACKAGEOPTS with the appropriate argument(s).
    7. To publish the i-model, use the command IMODELVISITOR ACTION PUBLISH.
    8. To package the i-model, use the command IMODELVISITOR ACTION PACKAGE.

To run the ExternApp example:

  1. Go to the project configured output directory to make sure there is an executable file
  2. Start the exectuable (preferrably under the debugger for stepping through for demonstration)
  3. The code:
    • First looks to list the registered Publishing Engines
    • Then connects to the first registered Publishing Engine
    • Then establishes a callback method to receive IPC messages from the Publishing Engine.
    • Then loads (in the delivered code) the imodelVisitor application (you need to build imodelvisitor first)
    • Then calls a command in the loaded application to drive the functionality required by the external program.
    • Then waits for the user to hit a key in the application window, this allows the user to see the message returned from the imodelvisitor application.

This demonstrates the basic functionality exposed in the i-model API.


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.