Rule to Define if a Representation is Main or Called (Schematic_GetRepresentationMode)

An opening ID is an entry point used to customize business logic. The Schematic_GetRepresentationMode opening ID lets you decide whether the symbol or the route placed in view for a logical object is the main or called representation.

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

This opening ID is invoked when a new symbol or route is placed in a diagram view using one of the following commands:

  • Create New Reference
  • Insert New Reference
  • Insert Existing Reference
  • Create From Existing Reference
  • Insert From Catalog
  • Place in View
  • Route in View
  • Create Route

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

Input Objects

Input objects must be of the following types:

  • ThisObject: Logical Occurrence
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Sheet_Reference (input) Object Type Read The reference of the sheet where the object is represented.
View_Reference (input) Object Type Read The reference of the view where the object is represented.
Sheet_System (input) Object Type Read The logical father of the sheet.
Object_System (input) Object Type Read The system of the fact object.
Is_Main_Already_Placed (input) Boolean Read says if at least one main representation of the logical object is already represented.
Is_Main (output) Boolean Write Boolean which says current symbol/route is main representation.

Sample

In the following sample, the rule compares the system name of sheet with the system name of logical object. Here the system name of logical object is taken from the V_description attribute of logical instance. If they are identical, then it returns main representation else it returns called representation.

let ThisOccObject (LogicalOccurrence)
set ThisOccObject = ThisObject
Let output_Is_Main(Boolean)
set output_Is_Main = true

let SheetSystemOcc(LogicalOccurrence)
set SheetSystemOcc = Parameters.GetAttributeObject ("Sheet_System")

let SystemSheetRef(RFLVPMLogicalReference)
set SystemSheetRef = SheetSystemOcc.Reference

Let IsMainAlreadyPlace(Boolean)
set IsMainAlreadyPlace = Parameters.GetAttributeBoolean ("Is_Main_Already_Placed")      

if(NULL <> SystemSheetRef)
{
   let SystemSheetName(string)
   set SystemSheetName = SystemSheetRef.Name   
   let ObjectInstance(RFLVPMLogicalInstance)
   set ObjectInstance = ThisOccObject.Instance
   if(NULL <> ObjectInstance)
    {
                let SystemObjectName(string)
                set SystemObjectName = ObjectInstance.GetAttributeString("V_description")
                if(SystemObjectName == "" OR (SystemObjectName == SystemSheetName AND  IsMainAlreadyPlace == FALSE))
                  set output_Is_Main = true
                else
                  set output_Is_Main = false
       }
}

Parameters.SetAttributeBoolean("Is_Main", output_Is_Main)