Quantcast
Channel: OpenPlant | AutoPLANT
Viewing all articles
Browse latest Browse all 12277

Wiki Page: OPPID - How to customize the tag number format

$
0
0
Introduction This document explains in which way the format of a tag number and pipeline annotation is defined and configured. Mostly a tag number consists of several different values which are concatenated often by using separating characters such as hyphens, dots or slashes. Placing a component and creating a new tag number In this example the Imperial workspace is used. Launch OpenPlant PID by selecting the ansi project and opening the PID_Example.dgn design file. For this exercise you don't need log in into the Project Database. In the PID Document dialog box expand the details and select the Plant tab Click the Add button to add a new Plant Area value Enter a new value for Name and click OK Click OK to close the PID Document dialog box Click the Parametric Instruments tool. Place the instrument and leader line (using the default options discrete and field) Select a device type code from the drop down list The area value that you previously defined in the PID Document dialog box is already predefined for this new component. This area is an associated item. That means that the value for the plant area is not locally stored with the instrument. The Plant Area is a separate object that is associated to the instrument Tag Number definition A tag number consisting of several concatenated values is defined in OpenPlant PID by using a calculated expression. This calculated expression is defined in a custom attribute. Below is an example of a Calculated Expression. The definition is located in the supplemental schema in the project's schema folder. A supplemental schema acts like an overly of another schema, in this case the OpenPlant schema. The parametric instrument has the class INSTRUMENT from the OpenPlant schema as base class. Therefore the corresponding project specific definitions are located in the supplemental schema of this project. To review this definition you need to launch the ECClass Editor. In OpenPlant PID open the Utilities menu and select ClassEditor. Open the OpenPlant_PID ecschema and supplement it with OpenPlant_PID_Supplemental_Imperial or OpenPlant_PID_Supplemental ecschema. These files are located in the WorkSpace\Projects\....\Dataset\schemas folders of a particular project Expand the class tree and select the class Instrument Click the Properties tab and select the property Number To have a better view on the Bentley_Standard_Custom Attributes.01.02:Calculated ECProperty Specification collapse the other items by clicking the on the right of each item. The following is displayed in this custom attribute: If you'd open the schema file in an editor the resulting XML is this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM:1:PLANT_AREA, NAME:?").NAME & "- " & this.DEVICE_TYPE_CODE & "-" & this.NUMBER Device ^[?\w]*-(? [\w]*)-(? [\w]*)|(? [\w]*) False ECExpression The tag number definition of the instruments is this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM:1:PLANT_AREA, NAME:?").NAME & "-" & this.DEVICE_TYPE_CODE & "-" & this.NUMBER The expression's sections and their meaning: this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM :1:PLANT_AREA, NAME:?").NAME Indicates to get the Name property of the Area that is related to this specific component via the Plant Area Has Named Item relationship & Used to concatenate values "-" Add a separating hyphen this.DEVICE_TYPE_CODE Include the DEVICE_TYPE_CODE value of this component this.NUMBER Include the NUMBER value of this component Syntax To add he value of a property of the same object: this.[Object Property Name] To add a value of a property from a related object: this.GetRelatedInstance("[Relationship Name]:1:[Source Object Name], [Source Property Name]:?").[Target Property Name] Failure Value The failure value is part of the error message in case the ec expression could not be resolved. It should indicate the component type where the error occurred. It is recommended to use the class name as failure value ParserRegularExpression The parser regular expression uses Perl-style regular expression patterns. You can find a desctiption on those expressions on this external web site: Regular Expression HOWTO This expression is used to parse back the tag number to its separate values. With this expression you can type in a tag number manually in the Businesskey field and the values are parsed back to the separate values. ^[?\w]*-(? [\w]*)-(? [\w]*)|(? [\w]*) ^ Required to start The parsing expression [?\w]* Inteprete the first part of the tag number as alphanumeric string until the 1 st hyphen. Display a ? if no value is selected - Look for literal – value. (? [\w]*) Allocate all characters after the first hyphen and before the second hyphen to the DEVICE_TYPE_CODE property - Look for literal – value. (? [\w]*) Allocate all characters after the last hyphen to the NUMBER Value. Blank or empty ParserRegularExpression When the ParserRegularExpression is blank, the tag number becomes readonly, only the tag parts can be modified. Also the Tag Number dialog [...] access from the Element Info becomes disabled. Limitations 1. Parser expression and associated items An associated item cannot be parsed back. Since it is not existing as a local property a new value of an associated item, such as the AREA of the instrument business key you can't type in a value for the area and hope that it gets assigned no matter if the value is existing as an AREA object or not. 2. No cascading use of GetRelatedInstance The value that is accessed via a relationship using GetRelatedInstance cannot be a calculated value itself

Viewing all articles
Browse latest Browse all 12277

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>