OPPID - Adding annotation box with unit and size


Question: I want to add acomponent that works sort of like a pipeline annotation. It is a box with UNIT inside it and run-size on the outside

Possible solution:

Create a new class under INSULATION as this best matches what it is your unit marker should do. What is important in order to properly pass properties between components is for a relationship to be established. In this case we will use the RUN_HAS_IN_RUN relationship.

Below is the XML format of what I have done.

You will need to add Connect Points to the stem of the marker where it connects to the line. In the cell library XML file (I placed mine in the PIping.cel library/xml file) set the Connect Points to zero distance from the origin with the origin of the cell being the base of the stem. To the class for the PIPERUN_UNIT_MARKER add a Schematics Cad Custom Attribute as shown.

           <SCHEMATICS_COMPONENT_CUSTOM_ATTRIBUTES xmlns="schematics.01.01">

               <USE_PREDEFINED_POINTS_FOR_RANGE>False</USE_PREDEFINED_POINTS_FOR_RANGE>

           </SCHEMATICS_COMPONENT_CUSTOM_ATTRIBUTES>

The first class is a new "base class" for markers like these and the second is the actual marker class itself. This is in the OpenPlant_PID schema. Note the properties for PIPERUN_SIZE and PIPERUN_UNIT.

   <ECClass typeName="PIPERUN_ANNOTATION_MARKERS" displayLabel="Piperun Annotaion Markers" isDomainClass="True">

       <BaseClass>INSULATION</BaseClass>

       <BaseClass>op:PIPING_INSULATION</BaseClass>

       <BaseClass>pid:BASE_INSULATION</BaseClass>

   </ECClass>

   <ECClass typeName="PIPERUN_UNIT_MARKER" displayLabel="Pipe Run Unit Marker" isDomainClass="True">

       <BaseClass>PIPERUN_ANNOTATION_MARKERS</BaseClass>

       <ECProperty propertyName="PIPERUN_UNIT" typeName="string" displayLabel="Piperun Unit">

           <ECCustomAttributes>

               <Category xmlns="EditorCustomAttributes.01.00">

                   <Standard>0</Standard>

                   <Name>GENERAL</Name>

                   <DisplayLabel>Generla Info</DisplayLabel>

                   <Priority>300</Priority>

               </Category>

           </ECCustomAttributes>

       </ECProperty>

       <ECProperty propertyName="PIPERUN_SIZE" typeName="string" displayLabel="Piperun Size">

           <ECCustomAttributes>

               <Category xmlns="EditorCustomAttributes.01.00">

                   <Standard>0</Standard>

                   <Name>GENERAL</Name>

                   <DisplayLabel>Generla Info</DisplayLabel>

                   <Priority>300</Priority>

               </Category>

           </ECCustomAttributes>

       </ECProperty>

   </ECClass>

Next in the OpenPlant_Supplemental schema I added the following.

   <ECClass typeName="PIPERUN_UNIT_MARKER" isDomainClass="True">

       <ECCustomAttributes>

           <SCHEMATICS_CAD_CUSTOM_ATTRIBUTES xmlns="schematics.01.01">

               <CellName>PIPERUN_UNIT_MARKER</CellName>

               <CellLibrary>Piping.cel</CellLibrary>

               <ElementTemplate>Piping\Fitting</ElementTemplate>

           </SCHEMATICS_CAD_CUSTOM_ATTRIBUTES>

           <SCHEMATICS_COMPONENT_CUSTOM_ATTRIBUTES xmlns="schematics.01.01">

               <USE_PREDEFINED_POINTS_FOR_RANGE>False</USE_PREDEFINED_POINTS_FOR_RANGE>

           </SCHEMATICS_COMPONENT_CUSTOM_ATTRIBUTES>

       </ECCustomAttributes>

       <ECProperty propertyName="END_CONDITION_DISPLAY" typeName="string">

           <ECCustomAttributes>

               <BMF_PROP_CUSTOM_ATTRIBUTES xmlns="bmf.01.01">

                   <DefaultValue>None</DefaultValue>

                   <IsGraphical>True</IsGraphical>

                   <FormatString />

               </BMF_PROP_CUSTOM_ATTRIBUTES>

               <HideProperty xmlns="EditorCustomAttributes.01.00">

                   <If2D>True</If2D>

                   <If3D>True</If3D>

               </HideProperty>

           </ECCustomAttributes>

       </ECProperty>

       <ECProperty propertyName="PIPERUN_UNIT" typeName="string">

           <ECCustomAttributes>

               <BMF_ANNO_CUSTOM_ATTRIBUTES xmlns="bmf.01.01">

                   <ORIGIN_OFFSET>0,0.5,0</ORIGIN_OFFSET>

                   <DIRECTION>1,0,0</DIRECTION>

                   <VISIBILITY>True</VISIBILITY>

                   <TEXT_STYLE>PID</TEXT_STYLE>

                   <PLACEMENT_COUNT>0</PLACEMENT_COUNT>

               </BMF_ANNO_CUSTOM_ATTRIBUTES>

           </ECCustomAttributes>

       </ECProperty>

       <ECProperty propertyName="PIPERUN_SIZE" typeName="string">

           <ECCustomAttributes>

               <BMF_ANNO_CUSTOM_ATTRIBUTES xmlns="bmf.01.01">

                   <VISIBILITY>True</VISIBILITY>

                   <TEXT_STYLE>PID</TEXT_STYLE>

                   <PLACEMENT_COUNT>0</PLACEMENT_COUNT>

                   <ORIGIN_OFFSET>0.625,0.5,0</ORIGIN_OFFSET>

                   <DIRECTION>1,0,0</DIRECTION>

               </BMF_ANNO_CUSTOM_ATTRIBUTES>

           </ECCustomAttributes>

       </ECProperty>

   </ECClass>

In order to pass UNIT and SIZE to the Marker you will need to pass the UNIT from the PIPING_NETWORK_SYSTEM to the PIING_NETWORK_SEGMENT and then onto the PIPERUN_UNIT_MARKER. SIze is already passed from SYSTEM to SEGMENT so you only need to pass it from SEGMENT to MARKER. See below for XML format of this.

UNIT from SYSTEM to SEGMENT. (OpenPlant_PID schema)

       <ECProperty propertyName="UNIT" typeName="string" description="code uses to describe the Plant Unit" displayLabel="Unit">

           <ECCustomAttributes>

               <Category xmlns="EditorCustomAttributes.01.00">

                   <Standard>0</Standard>

                   <Name>BUSINESSKEY</Name>

                   <DisplayLabel>Tag Information</DisplayLabel>

                   <Description>Tag Information</Description>

                   <Priority>80</Priority>

                   <Expand>True</Expand>

               </Category>

               <PropertyPriority xmlns="EditorCustomAttributes.01.00">

                   <Priority>89</Priority>

               </PropertyPriority>

               <ExtendType xmlns="EditorCustomAttributes.01.00">

                   <Name>AssociatedItems</Name>

               </ExtendType>

               <BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE xmlns="bmf.01.01">

                   <BMF_NOTIFY_RELATIONSHIPS>

                       <BMF_NOTIFY_RELATIONSHIP>

                           <NOTIFY_TARGET>True</NOTIFY_TARGET>

                           <RELATIONSHIP_CLASS_NAME>PIPELINE_HAS_PIPE_RUN</RELATIONSHIP_CLASS_NAME>

                           <RELATED_CLASS_NAME>oppid:PIPING_NETWORK_SEGMENT</RELATED_CLASS_NAME>

                           <RELATED_CLASS_PROPERTY_NAME>UNIT</RELATED_CLASS_PROPERTY_NAME>

                           <CASCADE_PROPERTY_VALUE_CHANGE>True</CASCADE_PROPERTY_VALUE_CHANGE>

                           <SET_DEFAULT_PROPERTY_VALUE>True</SET_DEFAULT_PROPERTY_VALUE>

                       </BMF_NOTIFY_RELATIONSHIP>

                   </BMF_NOTIFY_RELATIONSHIPS>

               </BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE>

           </ECCustomAttributes>

       </ECProperty>

SIZE and UNIT from SEGMENT to MARKER. (OpenPlant_PID schema)

SIZE:

                       <BMF_NOTIFY_RELATIONSHIP>

                           <NOTIFY_TARGET>True</NOTIFY_TARGET>

                           <RELATIONSHIP_CLASS_NAME>RUN_HAS_IN_RUN</RELATIONSHIP_CLASS_NAME>

                           <RELATED_CLASS_NAME>oppid:PIPERUN_UNIT_MARKER</RELATED_CLASS_NAME>

                           <RELATED_CLASS_PROPERTY_NAME>PIPERUN_SIZE</RELATED_CLASS_PROPERTY_NAME>

                           <CASCADE_PROPERTY_VALUE_CHANGE>True</CASCADE_PROPERTY_VALUE_CHANGE>

                           <SET_DEFAULT_PROPERTY_VALUE>False</SET_DEFAULT_PROPERTY_VALUE>

                       </BMF_NOTIFY_RELATIONSHIP>

UNIT:

               <BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE xmlns="bmf.01.01">

                   <BMF_NOTIFY_RELATIONSHIPS>

                       <BMF_NOTIFY_RELATIONSHIP>

                           <NOTIFY_TARGET>True</NOTIFY_TARGET>

                           <RELATIONSHIP_CLASS_NAME>RUN_HAS_IN_RUN</RELATIONSHIP_CLASS_NAME>

                           <RELATED_CLASS_NAME>oppid:PIPERUN_UNIT_MARKER</RELATED_CLASS_NAME>

                           <RELATED_CLASS_PROPERTY_NAME>PIPERUN_UNIT</RELATED_CLASS_PROPERTY_NAME>

                           <CASCADE_PROPERTY_VALUE_CHANGE>True</CASCADE_PROPERTY_VALUE_CHANGE>

                           <SET_DEFAULT_PROPERTY_VALUE>False</SET_DEFAULT_PROPERTY_VALUE>

                       </BMF_NOTIFY_RELATIONSHIP>

                   </BMF_NOTIFY_RELATIONSHIPS>

               </BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE>

Add the annotation atributes to the properties on the PIPERUN_UNIT_MARKER class in the OpenPlant Supplemental schema. You can also give these a category as well.

The cell library XML file is shown below. The name is teh CELL NAME andnot the class name.

 <CellData instanceID="PIPERUN_UNIT_MARKER" xmlns="SchematicsCells.01.00">

   <ConnectPoints>

     <NamedLocation>

       <Name>CP1</Name>

       <OriginOffset>0,0,0</OriginOffset>

       <Direction>-1,0,0</Direction>

     </NamedLocation>

     <NamedLocation>

       <Name>CP2</Name>

       <OriginOffset>0,0,0</OriginOffset>

       <Direction>1,0,0</Direction>

     </NamedLocation>

   </ConnectPoints>

 </CellData>