In this article, we will discuss different Tag number parsing and the results. These are defined in the OpenPlant_Supplemental_Tagging schema.
Similarly, tag format for any class can be added/modified. Below are some samples for EC expression as well as corresponding parser expressions.
Class
ANNOTATION_COMPONENTS
ECExpression
this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM:1:PLANT_AREA, NAME:?").NAME & "-" & this.DEVICE_TYPE_CODE & "-" & this.NUMBER
ParserRegularExpression
^[?\w]*-(?<DEVICE_TYPE_CODE>[?\w]*)-(?<NUMBER>.*)|(?<NUMBER>.*)
Result
A1-SP-0001
EQUIPMENT
this.DEVICE_TYPE_CODE & "-" & this.NUMBER
^(?<DEVICE_TYPE_CODE>.*)-(?<NUMBER>.*)|(?<NUMBER>.*)
PMP-0001
FLUID_REGULATOR
HV-0001
INSTRUMENT
A1-FT-0001
INSTRUMENT_LOOP/LOOP
A1-L-0001
NOZZLE
this.GetRelatedInstance("EQUIPMENT_HAS_NOZZLE:1:EQUIPMENT, DEVICE_TYPE_CODE:?").DEVICE_TYPE_CODE & "-" & this.GetRelatedInstance("EQUIPMENT_HAS_NOZZLE:1:EQUIPMENT, NUMBER:?").NUMBER & "-" & this.DEVICE_TYPE_CODE & this.NUMBER
^[?\w]*-[?\w]*-(?<DEVICE_TYPE_CODE>.)(?<NUMBER>.*)|(?<NUMBER>.*)
PMP-0001-N-1
PIPING_NETWORK_SYSTEM
this.UNIT_NAME & "-" & this.SERVICE_NAME & "-" & this.NUMBER & "-" & this.SPECIFICATION
^[?\w]*-[?\w]*-(?<NUMBER>[?\w]*)-(?<SPECIFICATION>.*)|(?<NUMBER>.*)
U1-Oil-0001-Ductile
Copy and paste table below to add new table.
Any class
Comment
This simple example checks to see if it's an email address, there are many ways to do it. This is a simple example looking for any characters, and seperated by an "@" symbol
this.AccountName&"-"&this.Company
^(?<AccountName>[A-Z0-9._%+-]*)@(?<Company>[\w]*).
Bentley_Software1234@bentley_systems.com
Any property example
this will look for digits and then parse out the " inches character. Example Size=12" would parse to Size=12 (had this request for annotation purposes, and they didn't want inches shown. Note: the value must be followed by a " inches character.
this.Size
^(?<SIZE>[\d]{1,3})"
1 or 12 or 123
^(?<AREA_NAME>[?\w]*)-(?<SERVICE_NAME>[?\w]*)-(?<DESIGN_SIZE>[?\w/"]*)-(?<SPECIFICATION>.*)-(?<NUMBER>[?\w]*)
^[?\w\s]*-(?<NUMBER>.*)-(?<SUFFIX>.*)
CM F-1234-1
^(?<PLANT_AREA>[a-zA-Z0-9]{1,2})(?<DEVICE_TYPE_CODE>[a-zA-Z]{1,2})(?<NUMBER>.*)|(?<NUMBER>.*)
A1HV1234
This allows for tag format without a delimiter and an unknown number of alpha characters
in the first property (Device Type Code) of the expression.
This example is for Equipment tag format Plant area- Device type code-Number(SUFFIX optional) with no limit in parser expression.
A1-PMP-0001 and A1-PMP-0001SU