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

let ThisOccObject (LogicalOccurrence)
set ThisOccObject = ThisObject
Let output_str_Label_Name(String)


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

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

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

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

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

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

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