Data

On the Home tab, the Data group contains tools for managing the data of diagram objects and generating position IDs for them.

Edit

Use the Edit tools to edit the data that diagram objects have in the SQL database.

Single object | Multiple objects

Single object

Select this command to edit the SQL data of objects in the active diagram, one object at a time.

Prerequisites

  • To pre-fill fields in the editor, the set_defaults script must contain definitions for CHECK_DATA and CHECK_DYNPANEL_FIELDS. You can find example definitions in the set_defaults script of the CADMATIC example project. For general information on this setup script, see The set_defaults Script.

Do the following:

  1. On the Home tab, in the Data group, select Edit > Single object.

  2. Select the objects whose data you want to edit from the active diagram, and press Enter. The Edit object data dialog opens, displaying the data of the first object you selected.

  3. Fill in and edit values as required.

  4. Click OK to accept the changes. If you entered a new Position ID and the ID is already in use, you are prompted to generate a new ID for it.

  5. If you selected to edit more than one diagram object, the data of the next object you selected opens. Fill in and edit values until all the objects you selected have been processed.

Tip: You can edit object data also via the Property pane.

Edit object data

In the Edit […] Data dialog, you can manage the data that a diagram object has in the SQL database.

The title of the dialog reflects the object type, so it can be one of the following:

  • Edit Armature Data
  • Edit Equipment Data
  • Edit Instrument Data
  • Edit Terminator Data

All objects, regardless of their type, have at least these fields that you can edit:

PosId

Position ID, usually automatically generated.

MenuItmData

Prefix and lookup key, specific to the symbol.

Description

Description of the object, automatically generated from MenuItmData.

In addition, there can be fields that are common for all objects of the same type, such as fields that all Equipment objects have.

Then, there are fields that are shared by the object subtype, such as fields that are specific to Equipment whose subtype is Valve.

In most fields, you can enter the required value by typing. Some fields also have special buttons for managing the value.

PosId field

The PosId field stores the Position ID of the diagram object. Typically, the ID is object-specific and automatically generated, so that opening the database card of a new object shows the ID that the program has assigned to it. The project administrator can select whether the IDs are generated, and how they are generated, as described in Administrating P&ID.

For example, the CADMATIC example project has been set up to use the combination of the prefix in the "MenuItmData" field and a 3-digit ordinal number to generate the PosId for objects whose type is Equipment or Armature.

Even if Position IDs are automatically generated, in the "PosId" field you can type a new ID for the current diagram object. If the given ID is already in use, you are prompted to generate a new one, so that this object's data can be stored in a separate database record.

Select Linked Object

Instead of generating or typing a new Position ID, you can link the current diagram object to an existing Position ID. This allows the linked objects to share the same data, and you can modify the data via any of the linked objects. Only Position IDs that have been checked in to COS can be selected for linking.

In the database card, use these buttons to manage the linking:

  • Link Object – Opens the Select Linked Object dialog where you can link the current diagram object to another diagram object of the same type. After this, the linked diagram objects use the same Position ID and data.

    The dialog lists the Position IDs that exist in COS and can be linked to the current object.

    You can filter the list to find the required Position ID:

    • Filter by System. Select a System from the list, or use the Pick tool to pick the System from another object.

    • Filter by Pipeline or Electrical Circuit, if applicable.

    • Enter a filter string in the Filter PosId field. You can use the asterisk character '*' as a wildcard.

    If the list is long, you can use the Previous/Next buttons to browse the list.

    Once you locate the required Position ID, select it from the list and click Ok.

    Tip: You can use the "Colors: By Linked Object" color-coding mode to see which objects in the current diagram are linked, as described in Colors. See also Manage linked objects.

  • Unlink Object – Unlinks the current diagram object. You must enter a new PosId for the object. After this, the current object will have its own data in the database, instead of using shared data.

  • Take Ownership – Editing the data of a diagram object sets the ownership of the data to that object. If you want to edit the data of linked objects and the current owner is some other object, use this command to take the ownership from that other object. Note that ownership cannot be transferred if the current owner has unsaved changes.

Tip: You can perform the above actions also from the Property pane.

DmPartCode field

The DmPartCode field stores the OID of the 3D component assigned to the diagram object.

Use these buttons to manage the part code information:

  • Clear – Removes the 3D component assignment from the diagram object.

  • Select – Opens the COS object browser for selecting the component to use in the 3D model.

  • Spec – Opens the Select Component dialog for selecting the component to use from the applicable specification. If Nominal Size is defined, only parts that match the given size are listed; otherwise, parts of all sizes are listed.

    After using Select or Spec to select the component to use in the 3D model, the component's preview image, Description, and main attributes (when selected from specification) are displayed in the side pane.

  • Map – Opens the Map 3D nodes dialog where you can map the nodes of the diagram object to the nodes of the associated 3D model object. For details, see Mapping nodes between P&I diagram and the 3D model.

Tip: You can perform the above actions also from the Property pane.

NS fields

Objects of type Armature have one Nominal Size field, NS, by default. You can use the Add button to add the fields NS2 and NS3, if needed.

About string type fields

If the type of a database field is wide string (WSTRING), when you are adding a value to the field you cannot use more than 1023 characters.

In the past, however, also longer strings were allowed, and therefore the functionality of the editor depends on the length of the existing value:

  • If the field contains a value that consists of 1–1023 characters, you can edit the value in the database editor, as usual.
  • If the field contains 1024 characters or more, the field is not displayed in the database editor at all.

Multiple objects

Select this command to edit the SQL data of objects in the open diagrams, one or more objects at a time.

Prerequisites

  • To pre-fill fields in the editor, the set_defaults script must contain definitions for CHECK_DATA_MULTI_EDIT and CHECK_DYNPANEL_FIELDS_MULTI_EDIT. You can find example definitions in the set_defaults script of the CADMATIC example project. For general information on this setup script, see The set_defaults Script.

Do the following:

  1. On the Home tab, in the Data group, select Edit > Multiple objects. The Edit P&ID Data dialog opens.

    Tip: You can turn the dialog into a dockable pane by selecting "Dockable" from the context menu of the title bar and dragging the dialog over an existing pane in the application window.

  2. In the top-left corner, select which of the currently open diagrams to edit. Selecting a diagram from this list (or from elsewhere in the application) sets that diagram as the active diagram.

  3. In the left pane, select the object type or sub-type that you want to edit. The objects in that category are listed in the table view, and the columns that cannot be edited are dimmed. The first column indicates availability, and it can show if the object is being edited by someone else lock icon, being edited by you pen icon, or not available due to replication stop icon.

  4. Select what information to show in the dialog.

    • Click Columns to add or remove columns. Only those columns that all the objects have in common can be displayed.

    • Click the filter button of a column to filter the table by the contents of that column.

  5. To see where an object is located in the active diagram, select the object from the list and click Locate.

  6. To edit a single value of a single diagram object, select the field and edit the value.

  7. To edit one or more values of one or more diagram objects, do the following:

    1. Hold down Ctrl or Shift and select the rows you want to edit, or use Ctrl+A to select all the rows.

    2. Click Edit Multiple. The Edit Multiple Rows dialog opens.

    3. Fill in the values, and click Ok.

  8. To export a visible table to a Microsoft Excel file, do the following:

    1. In the left pane, select the table view you want to export.

    2. Use the column selector and column filters to define what data to include in the export.

    3. Click Export.

    4. In the export dialog, enter a file name, select the file type (.xlsx or .xlsm), select the export location, and click Save.

  9. To import values from a Microsoft Excel file, do the following:

  10. To close the editor dialog, click the X button.

Tip: You can edit object data also via the Property pane.

Copy

You can copy data from one diagram object to other objects. You can copy data between different kinds of objects if they have matching fields in the database. If some of the target objects do not have all the fields you are copying, then that part of the data is skipped.

Do the following:

  1. In the Data group, click Copy. The Select Source dialog opens.

  2. Select from which source to copy the data: Object, System, Pipeline, Instrument Tag, or Electric Circuit.

  3. Depending on what you chose as the source, you are prompted to pick an object or a dialog opens for selecting a System, Pipeline, Tag, or Circuit.

  4. In the Select Data for copy dialog, select which values to copy from the specified source and click OK.

  5. In the Select Target(s) dialog, select to which targets to apply the data and click OK.

  6. Depending on what you chose as the target, you are prompted to pick the target objects or a dialog opens for selecting the target Systems, Pipelines, or Tags.

  7. In the Select target(s) dialog, click OK to complete the copying.

After this, the labels are automatically updated. However, if you copy e.g. Nominal Size from one pipeline to another, the labels are only updated when you save the diagram or perform some other command that is set to update the labels, as described in Automatic Update. You can update labels manually by selecting Home > Label > Update > All Labels.

Generate position ID

You can assign the next free position ID to a diagram object, even if it already has a position ID. If the object is linked, then also the objects it is linked to get the same new ID.

Tip: You can do this also from the Property pane: in the PosId row, select and then Generate position ID.

Do the following:

  1. On the Home tab, in the Data group, click Generate position ID.

  2. Pick a diagram object. One of the following occurs:

    • If the object does not have a position ID, the next free ID is assigned to it.

    • If the object already has a position ID, you are prompted whether to change the ID. If you select Yes, the next free ID is assigned to it.

  3. You can continue picking diagram objects to assign new position IDs to them or press Esc to exit the tool.

Related Topics

Position IDs