EKL - BL to get label symbol

Introduction

Usage : Apply automatically a label (should be chosen from input list of labels) on the symbols, routes or zones based on the main and called representations. Label symbols contains annotations and are stored in the Data Setup Default Label resource

Datasetup Resource Set : 

  • Diagram Resource

Datasetup Resource : Rule to get label symbol

 

Rule Example 1

Description

This rule allow to place a text automatically when placing a component

The text template to be used will depends on the logical object type

  • one text for Logical pipe : PipeLabelSymbol to display Parent LineId name
  • one text for logical piping Part : PipingPartLabelSymbol to display component Instance Name

Pre-Req

Define a logical object that contains one symbol per different text template

Attach this logical Reference into the Data setup under the resource "DefaultLabel"

Rule

/* Rule to get Label Symbol (Schematic_GetLabelInfo) */
/* ThisObject : #In LogicalOccurrence */ 
/* Parameters : #In RuleContext */
/* Add Label symbol on Logical Pipe */

if(ThisObject.IsASortOf("PipLogicalValveOcc"))
{
    Let output_str_Label_Name(String)
    set output_str_Label_Name = "PipingPartLabelSymbol"
    Parameters.SetAttributeString ("Label_Symbol_Name", output_str_Label_Name)
}

if(ThisObject.IsASortOf("PipLogicalMiscOcc"))
{
    Let output_str_Label_Name(String)
    set output_str_Label_Name = "PipingPartLabelSymbol"
    Parameters.SetAttributeString ("Label_Symbol_Name", output_str_Label_Name)
}

/*
if(ThisObject.IsASortOf("PipLogicalPipeOcc"))
{
    Let output_str_Label_Name(String)
    set output_str_Label_Name = "PipeLabelSymbol"
    Parameters.SetAttributeString ("Label_Symbol_Name", output_str_Label_Name)
}
*/

 

3DXML

 

 

Rule Example 2 

Description

Add a label to indicate if the symbol is a "Main Symbol" or "Called Symbol"

The rule returns the label symbol name as “MainLabel” if the representation mode is the main one otherwise it returns the name as “CalledLabel”.

Usually we are calling "Called Symbol" when an object is represneted in a Schema of another System the symbol of a Logical component instance is not sharing the same parent than the sheet neither the system in which it is placed. By default the valuation of the attribute is not automatically, need to go in "Properties/Schematic Symbol" tab. you can automate the valuation of the Is Main or Called thanks to another BR : (see Rule to get Representation Mode of Symbol)

Rule

/* ThisObject : #In LogicalOccurrence */

Let output_str_Label_Name(String)

Let Is_Main(Boolean)
set Is_Main = Parameters.GetAttributeBoolean ("Is_Main")

if(true == Is_Main)
   set output_str_Label_Name = "MainLabel"
else
   set output_str_Label_Name = "CalledLabel"

Parameters.SetAttributeString ("Label_Symbol_Name", output_str_Label_Name)

 

3DXML

 

Rule Example 3

Description

In the second sample, the rule takes the first text of the input list as the text to set on the zones of a zone category.

Note: When creating an automatic text for a zone category, you need to assign the same name to the Default Label resource values and to the zone category.

Pre-req

text template : knowledge package that contains Zone attributes is "Schematic Design"

Rule

/* ThisObject : #In CATSchRouteZone */
Let currentZoneCategory(String)

currentZoneCategory = ThisObject.Sch_Zone_Category

                Parameters.SetAttributeString("Label_Symbol_Name",currentZoneCategory)

3DXML

 

Rule Exemple 4 

Description

Not yet available will come in 2026

Generate texts that are a concatenation of information with separators

the following rules will generate the following 2 additionnal texts  

Lists definition to create in the BR

 

Rule

<strong>let</strong> ThisOccObject (LogicalOccurrence)
<strong>set</strong> ThisOccObject = ThisObject
<strong>Let</strong> output_str_Label_Name(String)


<strong>let</strong> listNames (List)
<strong>let</strong> name1 (String)
<strong>set</strong> name1 = "Text1"
listNames.Append(name1)
<strong>let</strong> name2 (String)
<strong>set</strong> name2 = "Text2"
listNames.Append(name2)
Parameters.SetAttributeObject("List_BuildText_Names", listNames)

<strong>let</strong> listTypes (List)
<strong>let</strong> typeSublist1 (List)
<strong>let</strong> typeSublist2 (List)
<strong>let</strong> type1 (String)
<strong>set</strong> type1 = "Separator"
<strong>let</strong> type2 (String)
<strong>set</strong> type2 = "RFLVPMLogicalInstance"
typeSublist1.Append(type1)
typeSublist1.Append(type2)
typeSublist2.Append(type1)
listTypes.Append(typeSublist1)
listTypes.Append(typeSublist2)
Parameters.SetAttributeObject("ListofList_BuildText_Types", listTypes)

<strong>let</strong> listAttributes (List)
<strong>let</strong> attrSublist1 (List)
<strong>let</strong> attrSublist2 (List)
<strong>let</strong> attr1 (String)
<strong>set</strong> attr1 = "~~~~"
<strong>let</strong> attr2 (String)
<strong>set</strong> attr2 = "_._._"
<strong>let</strong> attr3 (String)
<strong>set</strong> attr3 = "V_description"
attrSublist1.Append(attr1)
attrSublist1.Append(attr3)
attrSublist2.Append(attr2)
listAttributes.Append(attrSublist1)
listAttributes.Append(attrSublist2)
Parameters.SetAttributeObject("ListofList_BuildText_Attributes", listAttributes)

<strong>let</strong> listAnchors (List)
<strong>let</strong> anc1 (Integer)
<strong>set</strong> anc1 = 5
listAnchors.Append(anc1)
<strong>let</strong> anc2 (Integer)
<strong>set</strong> anc2 = 9
listAnchors.Append(anc2)
Parameters.SetAttributeObject("List_BuildText_Anchors", listAnchors)

<strong>let</strong> listX (List)
<strong>let</strong> x1 (Real)
<strong>set</strong> x1 = 10
listX.Append(x1)
<strong>let</strong> x2 (Real)
<strong>set</strong> x2 = -10
listX.Append(x2)
Parameters.SetAttributeObject("List_BuildText_XPos", listX)

<strong>let</strong> listY (List)
<strong>let</strong> y1 (Real)
<strong>set</strong> y1 = 10
listY.Append(y1)
<strong>let</strong> y2 (Real)
<strong>set</strong> y2 = -10
listY.Append(y2)
Parameters.SetAttributeObject("List_BuildText_YPos", listY)

<strong>let</strong> listUsePos (List)
<strong>let</strong> usepos1 (Integer)
<strong>set</strong> usepos1 = 2
listUsePos.Append(usepos1)
<strong>let</strong> usepos2 (Integer)
<strong>set</strong> usepos2 = 3
listUsePos.Append(usepos2)
Parameters.SetAttributeObject("List_BuildText_UsePos", listUsePos)