P&ID Scripts
Setup
Setup scripts allow the CADMATIC project administrator to customize the usage of the P&ID application according to the users' needs.
In the Project Environment dialog, the setup scripts can be found in [library] > Resources > Scripts > pd > setup.
The most important scripts here are set_defaults, labels, and sheets.
set_defaults
This script sets up several things:
- Pre-filling of database cards for equipment, electrics, armature and instruments. See Component lookup table.
- Managing the Position ID generator. The program suggests a new unique Position ID for each new PD object, as set up in this script.
- Controlling the generation of instruments.
labels
There are two steps when you insert a label (for example, a Position ID label) into a diagram.
- Label data is extracted from the database.
- A 2D symbol is called with the extracted data as an argument.
The labels script specifies data extraction routines for different purposes.
See The labels Script.
sheets
This script works together with the startup scripts. Since most organizations have a similar decoration style (border lines, title box symbol, etc.) for each drawing sheet size, the decoration style is taken out from per-sheet startup scripts to avoid duplicating code and for better managing of modifications.
In the example environment the sheets script stores the drawing sheet decoration styles together with
- settings for the grid
- cut parameters
- revision table
See The sheets Script.
ldclookup
This script is used to read COMPLOOKUP from ASCII. The script is created automatically.
Note: Do not edit this!
cretbls
This script is used to create database tables when you create the database and to clean the binary environment. The script is created automatically.
Note: Do not edit this!
Macro
The CADMATIC delivery environment contains some useful example scripts for P&ID.
In the Project Environment dialog, the example scripts can be found in [library] > Resources > Scripts > pd > macro.
ListDiagramsOfObject
This example script can be used to find out in which diagrams a given object (PosId) exists.
EquipmentList, ListUsedPipelines, UsedPositionIdsList
These example listings can be used to list the Equipment, Pipelines and Armature Position IDs that are used in a given diagram. These lists are printed on the diagram sheet itself.
Macrocmd
In the Project Environment dialog, [library] > Resources > Scripts > pd > macrocmd contains scripts that handle listings made from the P&ID application.