Rule to Choose a Label (Schematic_GetLabelInfo)

An opening ID is an entry point used to customize business logic. The Schematic_GetLabelInfo opening ID provides information about the label to be applied (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.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

The annotations inside the label symbol which are returned by the rule are automatically instantiated on any symbol or route placed or routed in view.

Definition Description
PLM Opening ID Schematic_GetLabelInfo
Customization intent Execution
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Logical Occurrence for routes and symbols or CATSchRouteZone for zones
  • Parameters corresponds to the context object

Context Object Parameters

Parameter Name Type Read or Write Comments
Is_Main (input) Boolean Read Says if the current representation is main or called.
List_All_Label_Symbol_Names (input) List Read

Lists names of symbol references available for the input object

Label_Symbol_Name (output) String Write

The name of the symbol reference to be used as a label.

Samples

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

let ThisOccObject (LogicalOccurrence)
set ThisOccObject = ThisObject

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)

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.

Let currentZoneCategory(String)

currentZoneCategory = ThisObject.Sch_Zone_Category

                Parameters.SetAttributeString("Label_Symbol_Name",currentZoneCategory)

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.