Objects from/to file

On the Modify tab, the Objects from/to file group contains tools for copying diagram objects such as pump units from one diagram to another. This is useful when the same object set is used in several diagrams. You can transfer objects within the same project or between different projects, either including the user-defined object data or with default values.

You can also import an entire diagram from a DEXPI XML file and export objects to a DEXPI XML file.

Import

Import | DEXPI Import

Import

Perform the following to import diagram objects from a file. The importer can run a script that modifies the import data, for example in the case that the data file has been exported from a different project and there are values that must be replaced.

Prerequisites

  • CADMATIC diagram export file (.cde).

  • Optionally, a script source file (*.mac) or script binary file (.bs) for additional processing of the import data.

Do the following:

  1. On the Modify tab, select Import > Import. The Script file dialog opens.

  2. Select the .cde file and click Open. The Import options dialog opens.

  3. Select the relevant options:

    • Include attribute data – Select this to import attributes.

    • Open data mapping tool – Select this to open a data mapping tool during the import.

    • Reset system and line data to default – Select this to import the data so that System and Line information is set to default values.

    • Data process script – You can select to run a script from a local file (Browse) or from the project environment (Select) to modify the import data.

    Then click OK. The imported objects are displayed in the diagram.

  4. Move the objects to the location where you want them to be placed. Then click to accept the location.

  5. If you chose to display the data mapping tool, the Import objects dialog opens, listing the contents of the import file. Perform the required actions, and then click OK to accept the mappings.

DEXPI Import

You can import a P&I diagram from a DEXPI (*.xml) file, one file at a time. The import creates a new P&I diagram that has the Pipelines, Instrument Tags, and attribute data defined in the DEXPI file.

Attribute values can be imported to either SQL fields or COS attributes.

Nominal size values that are defined in DEXPI as inches are converted in import to millimeters, if the project is using millimeters as nominal size units.

Graphics are imported as custom diagram objects that are assigned to object types (according to SQL main tables and sub-tables) based on mapped menu item data and DEXPI class.

Systems cannot be imported directly from the DEXPI file. However, DEXPI mappings allow System assignment to be taken from the attributes of the imported object. Moreover, pipelines and instrument tags are imported from the DEXPI file, and if the pipeline already exists in CADMATIC, the imported object is automatically mapped to the System of the pipeline.

Prerequisites

  • DEXPI XML file (version 1.3).

  • P&ID does not already contain a diagram by the same name.

  • Project administrator has created a DEXPI mappings configuration. The configuration can define an object class and a System for each different kind of diagram object to be imported, as well as attribute mappings that allow DEXPI attribute data to be imported to the SQL database or to COS.

    Tip: The mapping configuration object must exist before the first import, but the configuration can still be empty. When importing a DEXPI file, you can see which DEXPI types require mapping, and you can add new mappings to the configuration one import file at a time.

  • If you want to import labels as Label Definitions, your user profile must have the required permissions:

    • Your user profile allows creating of Labeling Styles.

      When you import labels as Label Definitions, the importer creates a Labeling Style called "DEXPI_labeling_style" if it does not already exist. (This is a one-time operation.)

    • Your user profile allows creating of Label definitions.

      When you import labels as Label Definitions, the importer creates a Label Definition for the labels that do not already have one and assigns them to "DEXPI_labeling_style".

  • If you import files that contain instruments, your user profile should have the required permissions:

    • Your user profile allows creating of 2D Symbols.

      When you import instruments, the importer creates a special 2D Symbol called "dexpi_instrument" if it does not already exist. (This is a one-time operation.)

Do the following:

  1. On the Modify tab, in the Objects from/to file group, select Import > DEXPI Import. The DEXPI Import dialog opens.

  2. In the DEXPI mapping field, select the mapping configuration to use for this import.

  3. Click Browse and select the XML file to be imported.

    The entities that can be imported from the selected file are displayed in the Selected file pane.

    • Entities that have no MenuItmData mapping (but should have, to be imported) are displayed in bold.

    • Entities that have unmapped DEXPI attributes display the number of unmapped attributes in parenthesis.

  4. Select Include unmapped objects as drafting graphics if you want all unmapped DEXPI objects to be imported as drafting objects that you can edit later with the tools on the Drafting tab.

  5. In Import labels as, select how to import labels for objects other than instruments:

    • Drafting text – Select this to import labels as editable drafting text.

    • Label definition – Select this to import labels as Label Definitions. If your user profile is not allowed to create Label Definitions, the importer tries to find an existing Label Definition that could be used instead, and notifies you if it finds one.

    • Project default – Select this to use the default Label Definitions of the project.

    • Exclude – Select this to ignore labels in import.

  6. Specify a Scale value for imported diagram symbols.

  7. Make sure that all diagram objects that you want to import are assigned to a System.

  8. Add a MenuItmData mapping for entities whose data is to be imported to a specific sub-table in the SQL database.

  9. Add attribute mappings for the entities you want to import: select the DEXPI attribute and click Edit.

  10. Make sure that all the required mappings are done.

    Then click OK to import the file.

  11. If you changed the mappings, you are prompted whether to save the changes.

    • If you select Yes, the new mappings are saved in the DEXPI Mappings configuration.

    • If you select No, the mappings are used for this import but then no longer available in future imports.

  12. If there were any problems, you are prompted whether to create a report. If you select Yes, you can specify a saving location for the report file (*.csv).

Export

Export | DEXPI Export

Export

Perform the following to export one or more diagram objects to a CADMATIC diagram export (.cde) file.

Do the following:

  1. On the Modify tab, select how to export:

    • Export – Select this to export objects with their user-defined data.
    • Export with Default Values – Select this to export objects with default data.
  2. Pick the objects to be exported, and press Enter to accept the set.

  3. Pick an origin point for the objects.

    Note: In file import, you can use the exported base point or change the base point, as required.

  4. In the Name of the export file dialog, specify a file name and saving location for the .cde file, and click Save.

The objects in the export file contain either the data from the specified diagram or default object data, as you specified. In file import, you can import this data as is or edit the data, as required.

Note: You can add the exported file to a custom menu to easily import the same object set to multiple diagrams. If copying between different projects, the menu item data has to match.

DEXPI Export

You can export diagram objects to a DEXPI (.xml) file that uses version 1.3 of the DEXPI format.

The export file contains all those objects in the active diagram whose "MenuItmData" database field has been mapped to a DEXPI type in the DEXPI Mappings configuration; also other SQL fields as well as COS attributes can be mapped to a DEXPI type. Instruments are automatically assigned to the "ProcessInstrumentationFunction" DEXPI type.

Prerequisites

  • Project administrator has defined suitable DEXPI mappings.

  • Node directions have been set in connection lines of type "iline". This allows the program to determine their correct DEXPI type.

Do the following:

  1. On the Modify tab, in the Objects from/to file group, select Export > DEXPI Export. The DEXPI Export type dialog opens.

  2. Select the export options:

    • Export template – Select the DEXPI Mappings configuration to use for the export.

    • Export contents

      • Selected objects in current diagram – Select this to export a set of objects from the active diagram.

      • Current diagram – Select this to export the active diagram.

      • Multiple diagrams – Select this to export one or more diagrams that you select from an object browser dialog (the active diagram does not have to be included).

    Then click Ok.

  3. If you chose to export selected objects from the current diagram, select the set of objects to be exported and press Enter.

  4. If you chose to export multiple diagrams, an object browser dialog opens. Hold down Ctrl or Shift and select the diagrams you want to include in the export, and then click OK.

  5. Specify the export location:

    • If exporting a single diagram, specify the file name and export folder, and click Save.

    • If exporting multiple diagrams, select the export folder and click Select Folder.

    The DEXPI file or files are exported to the specified location.

Related Topics

Manage linked objects