Schematic Design Functions

This page describes functions specific to the Piping & Tubing Systems Design app.

This page discusses:

ListZonesFromSheet

This function allows you to identify which zones are placed on a diagram view.

Signature

ListZonesFromSheet (iDifSheet, oListOfZonesInfo)
Name Input/Output Required? Type Comment
iDifSheet In DIFSheet The sheet containing the instance of the view in which the zones are created.
oListOfZonesInfo Out List List of zone information objects containing each zone’s name and description.

ReturnType

Integer

Example

In this example, the function is applied on a zone called Zone 1.

Let ListOfGBSElements(List)

Let ActiveViewInstance(DIFViewInstance)
Let ActiveSheet(DIFSheet)

Let ListIncludingZonesMessage(String)


GetSchActiveSheetAndView(ActiveSheet, ActiveViewInstance)

if(ActiveSheet <> NULL)
{
		//Retrieve List of Including Zones
		Let ListOfIncludingZones(List)
		ListIncludingZones(ActiveSheet,  ”Zone1"), ListOfIncludingZones)
		ListIncludingZonesMessage = ListIncludingZonesMessage + " For Zone 1: "
		if(ListIncludingZones.Size()>0)
		{	
			//If the Zone is included in one or more others, list them.
			let k = 1
			let ksize = 0
			ksize = ListOfIncludingZones.Size()
			for k while k<=ksize
			{
				Let IncZoneInfo(Feature)
				set IncZoneInfo = ListOfIncludingZones.GetItem(k)					
				ListIncludingZonesMessage = ListIncludingZonesMessage + " " + IncZoneInfo.GetAttributeString("SchZone_Name") + ","
			}
			ListIncludingZonesMessage = ListIncludingZonesMessage + "|"
		}
		else
		{
			ListIncludingZonesMessage = ListIncludingZonesMessage + 	" NONE " + "|"
		}							
		
	
}
Message(ListIncludingZonesMessage)

ListSpacesFromZones

This function allows you to retrieve the associations between the input zones and the corresponding space references declared in the platform.

Signature

ListSpacesFromZones (iDifSheet, iListOfZones, oListOfGBSElements)
Name Input/Output Required? Type Comment
iDifSheet In DIFSheet The sheet containing the instance of the view in which the zones are created.
iListOfZones In List List of zone information objects containing each zone’s name and description.
oListOfDesignSpaceReference Out List List in which each item is a List of corresponding space references defined in the platform, associated with the input zones.

ReturnType

Integer

Example

 
Let ListOfZoneInfos(List)
Let ListOfGBSElements(List)

Let ActiveViewInstance(DIFViewInstance)
Let ActiveSheet(DIFSheet)

Let ListZoneGBSAssociationsMessage(String)
let DSRElement(SSM_DesignSpaceRef)

GetSchActiveSheetAndView(ActiveSheet, ActiveViewInstance)

if(ActiveSheet <> NULL)
{
	//Fake Zones for Function demonstration purposes, the best way to retrieve zones is to use ListZonesFromSheet
	Let Zone1Info(Feature)
	Let Zone2Info(Feature)
	Zone1Info.SetAttributeString("SchZone_Name", "Zone 1")
Zone1Info.SetAttributeString("SchZone_Category", "Deck1")
Zone1Info.SetAttributeString("SchZone_Description", "Storage Room 1")
Zone2Info.SetAttributeString("SchZone_Name", "Zone 2")
Zone2Info.SetAttributeString("SchZone_Category", "Deck2")
Zone2Info.SetAttributeString("SchZone_Description", "Storage Room 2")

	listOfZoneInfos.Append(Zone1Info)
listOfZoneInfos.Append(Zone2Info)

	if(ListOfZoneInfos.Size() > 0)
	{
		//If Zones Exist, Retrieve their Associated Spaces
		ListSpacesFromZones(ActiveSheet, ListOfZoneInfos, ListOfGBSElements)
		ListZoneGBSAssociationsMessage = "The Associated GBS Elements are: " + "|"		
		let j = 1
		let jsize = 0
		jsize = ListOfZoneInfos.Size()
		for j while j<=jsize
		{
			//Retrieve Zone Attributes
			Let ZoneInfo(Feature)
			set ZoneInfo = ListOfZoneInfos.GetItem(j)
			ListZoneGBSAssociationsMessage  = ListZoneGBSAssociationsMessage + " For Zone " +  ZoneInfo.GetAttributeString("SchZone_Name") + ": "
			
			//Retrieve associated Space Element Attributes
			Let GBSInfoList(List)
			set GBSInfoList = ListOfGBSElements.GetItem(j)
			if(GBSInfoList<>NULL)
			{
				let k1 = 1
				let ksize1 = 0
				ksize1 = GBSInfoList.Size()
				if(ksize1>0)
				{
					for k1 while k1<=ksize1
					{
						Let GBSInfo(Feature)
						set GBSInfo = GBSInfoList.GetItem(k1)
						if(GBSInfo <>NULL)
						{
							set DSRElement = GBSInfo.GetAttributeObject("Space_Ref")
							if(DSRElement <> NULL)
ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + DSRElement.Name  + ","	
							else
								ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + "NULL,"			
						}
						else
							ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + "NULL " + "|"
					}
					ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + "|"
				}
				else
					ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + "NULL " + "|"
			}
			else
				ListZoneGBSAssociationsMessage = ListZoneGBSAssociationsMessage + "NULL " + "|"
							
		}
	}
}
Message(ListZoneGBSAssociationsMessage)

ListIncludingZones

This function verifies, for a given zone, the zones including this zone.

Signature

ListIncludingZones (iDifSheet, iZoneName, oListOfIncludingZonesInfo)
Name Input/Output Required? Type Comment
iDifSheet In DIFSheet The sheet containing the instance of the view in which the zones are created.
iZoneName In List Zone Name for which you need to know the including zones encapsulating it.
oListOfIncludingZonesInfo Out List List of zone information objects that hold the information about every zone that encapsulates the input zone, from the closest to the furthest.

ReturnType

Integer

Example

In the following example, the function is set on a zone called Zone 1 to determine if it is nested in another zone.

Let ListOfGBSElements(List)

Let ActiveViewInstance(DIFViewInstance)
Let ActiveSheet(DIFSheet)

Let ListIncludingZonesMessage(String)


GetSchActiveSheetAndView(ActiveSheet, ActiveViewInstance)

if(ActiveSheet <> NULL)
{
		//Retrieve List of Including Zones
		Let ListOfIncludingZones(List)
		ListIncludingZones(ActiveSheet,  ”Zone1"), ListOfIncludingZones)
		ListIncludingZonesMessage = ListIncludingZonesMessage + " For Zone 1: "
		if(ListIncludingZones.Size()>0)
		{	
			//If the Zone is included in one or more others, list them.
			let k = 1
			let ksize = 0
			ksize = ListOfIncludingZones.Size()
			for k while k<=ksize
			{
				Let IncZoneInfo(Feature)
				set IncZoneInfo = ListOfIncludingZones.GetItem(k)					
				ListIncludingZonesMessage = ListIncludingZonesMessage + " " + IncZoneInfo.GetAttributeString("SchZone_Name") + ","
			}
			ListIncludingZonesMessage = ListIncludingZonesMessage + "|"
		}
		else
		{
			ListIncludingZonesMessage = ListIncludingZonesMessage + 	" NONE " + "|"
		}							
		
	
}
Message(ListIncludingZonesMessage)

MapSchSymbolWithGivenInstance

This function lets you to map a symbol and a connection point to a logical instance or to a port.

Signature

MapSchSymbolWithGivenInstance(iSymbol : DifSymbol, iInstancePath : List, iOriginPort : List, iTargetPort : List) : List

Arguments

Name Input/Output Required? Type Comment
iSymbol In DifSymbol The symbol to be mapped with the given instance.
iInstancePath In List The path of the instance to be mapped with the symbol.
iOriginPort In List

Lists the ports of the reference of the instance previously mapped with the symbol.

iTargetPort In List Lists of ports of the reference of the new instance.
Important:
  • This list must be the same size as iOriginPort.
  • The target ports must be connected to the same routes and the connection point of the origin ports.

ReturnType

Integer

Map a symbol with connection points connected to a route

Three logical equipment components with three ports each have been created. One equipment component is instantiated under Logical Reference 1. The two other equipment components are instantiated under Logical Reference 2, and one equipment component has its ports connected to a pipe.

The following function is called:

let Symbol(CATSchSymbolInstance) //ARG1
let ListInputInst(List) //ARG2
ListInputInst.Append(TargetOcc.Instance)
let ListOriginPort(List) //ARG3
ListOriginPort.Append(OriginPort)
let ListTargetPort(List) //ARG4
ListTargetPort.Append(TargetPort)

//Get View Reference from View Instance
let ViewRef(DIFView)
set ViewRef = ViewInst.Reference
if(NULL <> ViewRef)
{
	let ListSymbols(List)
	ViewRef.GetSymbols(ListSymbols)	
	set Symbol = ListSymbols.GetItem(1)
}

let FatherOcc(LogicalOccurrence)
set FatherOcc = TargetOcc.Owner
let i(Integer)

for i  while FatherOcc <> NULL
{
	if(FatherOcc.Instance <> NULL)
	{
		ListInputInst.InsertItem(FatherOcc.Instance, 1)
		set FatherOcc = FatherOcc.Owner
	}
	else
	{
		set FatherOcc = NULL
	}
}

let iReturn(Integer)
set iReturn = MapSchSymbolWithGivenInstance(Symbol, ListInputInst, ListOriginPort, ListTargetPort)
Message("The return code is: " + iReturn)

After calling the function, the symbol is linked with the second equipment component with its ports properly mapped.

GetSchActiveSheetAndView

This function retrieves the active sheet and the active view under the active object. The active view is the view that is displayed.

Signature

GetSchActiveSheetAndView(oDifActiveSheet : DIFSheet, oDifActiveViewInstance : DIFViewInstance) : Integer

Arguments

Name Input/Output Required? Type Comment
oDifActiveSheet Out DIFSheet The active sheet
oDifActiveViewInstance Out DIFViewInstance The active view

ReturnType

Integer

Example

In the following example, this rule sets colors and changes the line type and the line thickness of all the Equipment represented in the active view.

Let MyInstance(PLMCoreInstance)
Let EquipmentInstance(EnsLogicalEquipmentInst)
Let ListOfSheets(List)
Let ListOfViews(List)
Let MySheet(DifSheet)
Let MyView(DifViewInstance)
Let ListRGB(List)
Let ListGraphAttrNames(List)
Let ListGraphAttrValues(List)
set MyInstance = LogOcc.Instance
set EquipmentInstance = MyInstance

//Only for Equipments
if(EquipmentInstance <> NULL)
{
	//Retrieve the active sheet an view 
GetSchActiveSheetAndView(MySheet, MyView)

	//Add the red color in the graphic attributes list
	ListGraphAttrNames->Append("LineColor")
	ListRGB->Append(255)
	ListRGB->Append(0)
	ListRGB->Append(0)
	ListGraphAttrValues->Append(ListRGB)

	//Change the line type
	ListGraphAttrNames->Append("LineType")
	ListGraphAttrValues->Append(3)

	//Change the line thickness
	ListGraphAttrNames->Append("LineThickness")
	ListGraphAttrValues->Append(6)

	//Set the color on each view of the session
	SetSch2DGraphicProperties(MyInstance, MyView, ListGraphAttrNames, ListGraphAttrValues)
}

GetSchSymbolInformations

This function provides information about all the symbols representing the input instance.

Signature

GetSchSymbolInformations(iPLMInstance : PLMCoreInstance, oListOfSheets : List, oListOfViews : List, oListOfSymbolAttributes : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreInstance The instance of an object.
oListOfSheets Out List The sheets where the input instance is represented by a symbol.
oListOfViews Out List The view instances where the input PLM instance is represented by a symbol.
oListOfSymbolAttributes Out List The list of properties of the symbols representing the input instance. Each object in this list has:
  • SymbolInstance_Name: the name of the symbol instance (String)
  • SymbolInstance_PositionX_InSheet: the X coordinate of the position of the symbol in the sheet (Double)
  • SymbolInstance_PositionY_InSheet: the Y coordinate of the position of the symbol in the sheet (Double)
  • SymbolInstance_PositionX_InFrame: the X coordinate of the position of the symbol in the frame (String)
  • SymbolInstance_PositionY_InFrame: the Y coordinate of the position of the symbol in the frame (String)
  • SymbolInstance_Rotation: the angle rotation of the symbol (Double)
  • SymbolInstance_IsFlip: return true if the symbol is flip else false (Boolean)
  • SymbolInstance_Scale: the scale of the symbol (Double)
  • SymbolInstance_ContainerType: Geographical Container, or Composite, or Composite Container, or None (String)
  • SymbolInstance_ZoneComputationMode: OneZone or TwoZones (String)
  • SymbolInstance_ZoneNamesList: the list of the zones names containing an existing Symbol (List of String)
Note: The three output lists must have the same size (mandatory).

ReturnType

Integer

Example

Let LogInstance(PLMCoreInstance)
Let ListOfSheets(List)
Let ListOfViews(List)
Let ListOfSymbolInfos(List)
Set LogInstance = ThisObject.Instance
GetSchSymbolInformations(LogInstance, ListOfSheets, ListOfViews, ListOfSymbolInfos)

Let j = 1
Let jsize = 0
Let DisplayMessage(String)
jsize = ListOfSymbolInfos->Size()
if(ListOfSheets->Size() == jsize and ListOfViews->Size() == jsize)
{
for j while j<=jsize
{
set DisplayMessage =""

Let Sheet(DIFSheet)
Let SheetInstance(DIFSheetInstance)
Let View(DIFViewInstance)
Let SymbolInfo(Feature)
Let ListofZone(List)

set Sheet = ListOfSheets.GetItem(j)
set SheetInstance =  ListOfSheets.GetItem(j)
set View = ListOfViews.GetItem(j)
set SymbolInfo = ListOfSymbolInfos.GetItem(j)

set ListofZone = SymbolInfo.GetAttributeObject("SymbolInstance_ZoneNamesList")
if((SheetInstance <> NULL or Sheet <> NULL)  and View <> NULL and  SymbolInfo <> NULL)
{
DisplayMessage = "- Symbol Name: "+ SymbolInfo.GetAttributeString("SymbolInstance_Name") +"|"
			DisplayMessage = DisplayMessage +  "- Representation Mode : " +  SymbolInfo.GetAttributeString("SymbolInstance_RepresentationMode")+ "|"
			DisplayMessage = DisplayMessage + "- It is in " 
			if(Sheet <> NULL)
			    DisplayMessage = DisplayMessage +  Sheet.Name
		               if(SheetInstance <> NULL)
			    DisplayMessage = DisplayMessage +  SheetInstance.Name	
			DisplayMessage = DisplayMessage + " : "+ View.Name + "|"
DisplayMessage = DisplayMessage +"- Position in Sheet : (" +SymbolInfo.GetAttributeReal("SymbolInstance_PositionX_InSheet") + ", "+ SymbolInfo.GetAttributeReal("SymbolInstance_PositionY_InSheet") + ")  |"

DisplayMessage = DisplayMessage +"- Rotation : " +SymbolInfo.GetAttributeReal("SymbolInstance_Rotation") + "  |"
DisplayMessage = DisplayMessage +"- IsFlip : " +SymbolInfo.GetAttributeString("SymbolInstance_IsFlip") + "  |"
DisplayMessage = DisplayMessage +"- Scale : " +SymbolInfo.GetAttributeReal("SymbolInstance_Scale") + "  |"
DisplayMessage = DisplayMessage +"- Container Type : " +SymbolInfo.GetAttributeString("SymbolInstance_ContainerType") + "  |"
DisplayMessage = DisplayMessage +"- Zone Computation Mode : " +SymbolInfo.GetAttributeString("SymbolInstance_ZoneComputationMode") + "  |"
DisplayMessage = DisplayMessage +"- Position in Frame : (" +SymbolInfo.GetAttributeString("SymbolInstance_PositionX_InFrame") + ", "+ SymbolInfo.GetAttributeString("SymbolInstance_PositionY_InFrame") + ")  |"
DisplayMessage = DisplayMessage +"- In Zones : ("
let ZoneName(string)
for ZoneName inside ListofZone
DisplayMessage = DisplayMessage + ZoneName +", "
DisplayMessage = DisplayMessage +") |"
DisplayMessage = DisplayMessage +"- Father Name :   " + SymbolInfo.GetAttributeString("SymbolInstance_FatherContainerSymbolName") + " |"
DisplayMessage = DisplayMessage +"- Father Instance Name : " + SymbolInfo.GetAttributeString("SymbolInstance_FatherContainerInstanceName") + " |"

Message(DisplayMessage)
}
}
}

ListSheetsAndViewsFromObject

This function lets you know in which diagram views a logical instance is represented.

Signature

ListSheetsAndViewsFromObject(iPLMInstance: PLMCoreInstance, oSheetsList: List, oViewsList: List): Integer
Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreInstance Instances, which are represented as a symbol, a route, or a port and are searched in sheet and diagram views.
oSheetsList Out List List of sheets where the instance is represented.
oViewsList Out List List of diagram view where the instance is represented.
Note: oSheetsList and oViewsList have the same size. For each diagram view instance in oSheetsList, the corresponding sheet can be found at the same index in oViewsList.

PlaceSchSymbolFromInstance

This function allows you to place a symbol on a diagram.

Signature

PlaceSchSymbolFromInstance(Instance_To_Place : List, View_Instance : DIFViewInstance , X_Position : Real, Y_Position : Real, Symbol_Name : String) : Integer

Arguments

Name Input/Output Required? Type Comment
Instance_To_Place In List The path of instances of the instance that must be placed in the diagram.
View_Instance In DIFViewInstance The view where the input instance must be placed.
Note: This input is mandatory.
X_Position In Real The X position where the symbol will be placed. The coordinates are given in sheet coordinate system.
Note: The default value is 0.
Y_Position In Real The Y position of where the symbol will be placed. The coordinates are given in sheet coordinate system.
Note: The default value is 0.
Symbol_Name In String The name of the symbol that is used.
Notes:

The default symbol will be used if no name is provided.

Symbol names can be retrieved using the existing function ListSymbolReferenceNamesforPLMReference.

ReturnType

Integer

Example

let eqtRef(EnsLogicalEquipment)
let eqtInst(EnsLogicalEquipmentInst)
set eqtRef = ThisObject.Reference
set eqtInst = ThisObject.Instance
let pathOfInst(List)
pathOfInst.SetItem(eqtInst, 1)
let XPos(real)
set XPos = 0
let YPos(real)
set YPos = 0
let symbolName(string)

if(NULL <> eqtRef and NULL <> eqtInst)
{
	let eqtName(string)
	set eqtName = eqtInst.Name
	if(eqtName == "Eqt1.2")
	{
		set XPos = 50
		set YPos = 70
		set symbolName = "SymbRef2"
	}

	let viewInst(DIFViewInstance)
	let sheet(DifSheet)
	GetSchActiveSheetAndView(sheet, viewInst)
	PlaceSchSymbolFromInstance(pathOfInst, viewInst, XPos, YPos, symbolName) 
}

ReplaceSymbolInSchematicView

This function lets you switch symbol in a diagram view for a given logical instance.

Signature

ReplaceSymbolInSchematicView (iPLMInstance: PLMInstance, iSymbolInstanceName: SymbolInstanceName, iSymbolReferenceName: SymbolReferenceName, iDifViewReference: DIFViewReference): Integer
Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreReference The logical instance of the object for which the symbol is to be replaced.
iSymbolInstanceName In String The name of the symbol instance representing the input logical instance.

Those names can be retrieved using the GetSchSymbolInformations method.

Note:
  • If this input string is empty, all symbol instances of the input logical instance will be replaced in the diagram view.
  • If this input string is not empty but does not match any existing symbolinstance representing the input logical instance, the function will fail.
iSymbolReferenceName In String The name of a symbol reference associated with the logical reference of the input logical instance.

This name can be retrieved using the ListSymbolReferenceNamesFromPLMReference method.

Note: If this input string is empty or does not match any existing symbol reference available for the input logical instance, the function will fail.

iDifViewReference In DIFView The diagram view in which the symbol is to be replaced.
Note: If this input is NULL, symbols will be replaced in every diagram view of the session.

Return Code
Integer

Example

In this first example, the function updates a symbol reference from a diagram view.

//Retrieve all the symbols from the input view
let DifViewRef(DifView)
set DifViewRef = DifViewInst.Reference
let ListOfSymbolsInView(List)
DifViewRef.GetSymbols(ListOfSymbolsInView)

Message("Replacing " + ListOfSymbolsInView.Size() + " symbols from " + DifViewRef.Name)

//For each symbol in the view
let SymbolToReplace(DifSymbol)
let DisplayedMessage(String)
for SymbolToReplace inside ListOfSymbolsInView
{	
	//Retrieve the symbol instance name
	let SymbolInstanceName(String)
	set SymbolInstanceName = SymbolToReplace.GetAttributeString("alias")
	
	//Retrieve the PLM Instance and PLM Reference represented by the symbol
	let RepresentedInstance(RFLVPMLogicalInstance)
	let RepresentedReference(PLMCoreReference)
	let ListOfReprentedObjects(List)
	SymbolToReplace.GetRepresentedObject(ListOfReprentedObjects)

	if(ListOfReprentedObjects.Size() > 0)
	{
		let VODOfRepresentedObject(List)
		set VODOfRepresentedObject =  ListOfReprentedObjects.GetItem(1)
		if(VODOfRepresentedObject.Size() > 0)
		{
			set RepresentedInstance = VODOfRepresentedObject.GetItem(VODOfRepresentedObject.Size())
			set RepresentedReference = RepresentedInstance.Reference
		}
	}
	
	//Retrieve the names of the Symbol References available for the PLM Reference represented by the symbol
	let ListOfSymbolReferencesNames(List)
	ListSymbolReferenceNamesFromPLMReference(RepresentedReference, ListOfSymbolReferencesNames)	

	//Replace the symbol by another (in this example we take the second symbol reference in the list)
	let SymbolReferenceName(String)
	set SymbolReferenceName = ListOfSymbolReferencesNames.GetItem(2)
	ReplaceSymbolInSchematicView(RepresentedInstance, SymbolInstanceName, SymbolReferenceName, DifViewRef)
	
	//Display a message on the screen
	set DisplayedMessage = "Symbol " + SymbolInstanceName + " of "+ RepresentedInstance.Name + " are replaced by " + SymbolReferenceName + " from the PLM Reference " + RepresentedReference.Name
	Message(DisplayedMessage)

In this second example, the function updates a symbol reference from a logical instance.

//Retrieve the selected PLM Instance and PLM Reference
let RepresentedInstance(PLMCoreInstance)
set RepresentedInstance = PLMOccurrence.Instance
let RepresentedReference(PLMCoreReference)
set RepresentedReference = PLMOccurrence.Reference

//Retrieve the names of the Symbol References available for the PLM Reference represented by the symbol
let ListOfSymbolReferencesNames(List)
ListSymbolReferenceNamesFromPLMReference(RepresentedReference, ListOfSymbolReferencesNames)	

//Replace all the symbols of the input PLM Instance by another (in this example we take the second symbol reference in the list)
let SymbolReferenceName(String)
set SymbolReferenceName = ListOfSymbolReferencesNames.GetItem(2)
ReplaceSymbolInSchematicView(RepresentedInstance, "", SymbolReferenceName, NULL)

//Display a message on the screen
let DisplayedMessage(String)
set DisplayedMessage = "Symbols of "+ RepresentedInstance.Name + " are replaced by " + SymbolReferenceName + " from the PLM Reference " + RepresentedReference.Name
Message(DisplayedMessage)

SetSch2DGraphicProperties

This function allows you to modify the graphic properties of all symbols.

Signature

SetSch2DGraphicProperties(iPLMInstance : PLMCoreInstance, iDifViewInstance : DIFViewInstance, iListOfParametersNames : List, iListOfParametersValues : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreInstance The instance of the object represented by the symbol, a route, or a port to modify.
iDifViewInstance In DIFViewInstance The view where the input instance is represented.
iListOfParametersNames In List

The list of graphic properties names to modify.

The accepted values are:

  • LineColor
  • LineType
  • LineThickness

iListOfParametersValues In List The list of graphic properties values to set on the symbol to modify.
  • LineColor values are a list of integer between 0 and 255. The first integer is the red component, the second is the green component and the last is the blue component.
  • LineType values are integers.
  • LineThickness values are integers.

ReturnType

Integer

Example

Let MyInstance(PLMCoreInstance)
Let EquipmentInstance(EnsLogicalEquipmentInst)
Let ListOfSheets(List)
Let ListOfViews(List)
Let MySheet(DifSheet)
Let MyView(DifViewInstance)
Let ListRGB(List)
Let ListGraphAttrNames(List)
Let ListGraphAttrValues(List)
set MyInstance = LogOcc.Instance
set EquipmentInstance = MyInstance

//Only for Equipments
if(EquipmentInstance <> NULL)
{
	//Retrieve the sheets an views where the instance is represented 
	ListSheetsAndViewsFromObject(MyInstance, ListOfSheets, ListOfViews)

	//Add the red color in the graphic attributes list
	ListGraphAttrNames->Append("LineColor")
	ListRGB->Append(255)
	ListRGB->Append(0)
	ListRGB->Append(0)
	ListGraphAttrValues->Append(ListRGB)

	//Change the line type
	ListGraphAttrNames->Append("LineType")
	ListGraphAttrValues->Append(3)

	//Change the line thickness
	ListGraphAttrNames->Append("LineThickness")
	ListGraphAttrValues->Append(6)

	//Set the color on each view of the session
	for MyView inside ListOfViews
	{	
		SetSch2DGraphicProperties(MyInstance, MyView, ListGraphAttrNames, ListGraphAttrValues)
	}
}

GetSchematicRoutedLengthPerView

This function allows the length of the logical pipe to be retrieved.

Signature

GetSchematicRoutedLengthPerView(iPLMInstance : PLMCoreInstance, oListOfRoutedLength : List, oListOfViewInstance : List, oListOfOnOffSheetConnectors : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreInstance -
oListOfRoutedLength Out List Lists the total length of all routes representing the given logical instance per view and in millimeter (sheet size).
oListOfViewInstance Out List Lists view instances.
oListOfOnOffSheetConnectors Out List Lists Boolean. If the Boolean is TRUE, the route is connected to a sheet connector. If the Boolean is FALSE, it means the route is not connected to a sheet connector.

ReturnType

Integer

Example

This script prompts a message showing the pipe instance name, the length in each view where it is placed and the presence or not of a sheet connector.

 

Let ListOfRoutedLength(List)
Let ListOfViewInstances(List)
Let ListOfOnOffSheetConnectors(List)
Let PipeInstance(PLMCoreInstance)
Let j = 1
Let jsize = 0
Let RoutedLength(Real)
Let DisplayMessage(String)
Let OnOffSheetConnector(Boolean)
Let DifViewInstance(DIFViewInstance)

Set PipeInstance = ThisObject.Instance
GetSchematicRoutedLengthPerView(PipeInstance, ListOfRoutedLength, ListOfViewInstances, ListOfOnOffSheetConnectors)

jsize = ListOfRoutedLength->Size()
if(ListOfViewInstances->Size() == jsize and ListOfOnOffSheetConnectors->Size() == jsize)
{
	DisplayMessage = PipeInstance.GetAttributeString("PLM_ExternalID")
	DisplayMessage = DisplayMessage + " = "
	for j while j<=jsize
	{
		set DifViewInstance = ListOfViewInstances[j]
		set RoutedLength = ListOfRoutedLength[j]
		set OnOffSheetConnector = ListOfOnOffSheetConnectors[j]
		DisplayMessage = DisplayMessage + RoutedLength + " mm in " + DifViewInstance.GetAttributeString("PLM_ExternalID")
		if(OnOffSheetConnector == TRUE)
			DisplayMessage = DisplayMessage + " and has an On/Off sheet connector;"
		else
			DisplayMessage = DisplayMessage + " and does not have an On/Off sheet connector;"
	}
	Message(DisplayMessage)

ListSheetsFromObject

This function lists all the sheets where a given instance is represented.

Signature

ListSheetsFromObject(iPLMInstance : PLMCoreInstance, oListOfSheets : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iPLMInstance In PLMCoreInstance -
oListOfSheets Out List Lists the views containing the instance.

ReturnType

Integer

Example

This script prompts a message showing the instance name and where it is placed.

 
Let LogInstance(PLMCoreInstance)
Let ListOfSheets(List)
Set LogInstance = ThisObject.Instance
ListSheetsFromObject(LogInstance, ListOfSheets)

Let j = 1
Let jsize = ListOfSheets->Size()
Let DisplayMessage(String)
if(jsize > 0 and LogInstance <> NULL)
{	
	for j while j<=jsize
	{
		set DisplayMessage =""
		Let Sheet(DIFSheet)
		set Sheet = ListOfSheets.GetItem(j)

		if(Sheet <> NULL )
		{
			DisplayMessage = LogInstance.Name 
			DisplayMessage = DisplayMessage + " is in " 
			DisplayMessage = DisplayMessage +  Sheet.Name
			Message(DisplayMessage)
		}
	}
}

GetSchSheetConnectorInformations

This function allows you to retrieve information about connected sheet connectors placed in different sheets.

Signature

CATGetSchSheetConnectorInformations(iRoutableInstance : PLMCoreInstance, oListOfSheetCntrInfos : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iRoutableInstance In PLMCoreInstance The logical instance of the routable.
oListOfSheetCntrInfos Out List Lists of properties of the sheet connector connected to the input instance.

Each object in the list has the following string attributes:

  • SheetConnector_Object_Name: the name of the analyzed sheet connector instance (String)
  • SheetConnector_RelatedOffSheetObject_Name: the list of names of the offsheets related to the sheet connector (List of String)
  • SheetConnector_RelatedRoutable: the routable related to this offsheet on the other side (CATIPLMComponent)
  • SheetConnector_RelatedComponent: the component related to this offsheet on the other side (CATIPLMComponent)
  • SheetConnectors_SheetReference: the sheet reference of this sheet connector (CATBaseUnknown)
  • SheetConnector_SheetInstance: the sheet instance of this sheet connector (CATBaseUnknown)
  • SheetConnector_ViewReference: the view reference of this sheet connector (CATBaseUnknown)
  • SheetConnector_ViewInstance: the view instance of this sheet connector (CATBaseUnknown)
  • SheetConnector_PositionX_InSheet: the X coordinate of the symbol's position in the sheet (Double)
  • SheetConnector_PositionY_InSheet: the Y coordinate of the symbol's position in the sheet (Double)
  • SheetConnector_FramePositionX: the X coordinate of the symbol's position in the frame (String)
  • SheetConnector_FramePositionY: the Y coordinate of the symbol's position in the frame (String)

ReturnType

Integer

Example

Two sheets are created in two different diagram views containing a routable connected to two different sheet connectors.

In the following example, the function is set for:

  • A routable connected to two different sheet connectors
  • Two routables connected to two different sheet connectors
  • A routable connected to an unconnected sheet connector

Let RoutableInstance(PLMCoreInstance)
Let DisplayMessage(String)
Set RoutableInstance = ThisObject.Instance
Let ListOfSheetCntrInfos(List)
GetSchSheetConnectorInformations(RoutableInstance, ListOfSheetCntrInfos)

Let j = 1
Let jsize = 0
jsize = ListOfSheetCntrInfos->Size()
Let ListofRelatedName(List)

for j while j<=jsize
{                               
	Let SheetCntrInfos(Feature)
	set SheetCntrInfos = ListOfSheetCntrInfos.GetItem(j)
                                
    	 if(SheetCntrInfos <> NULL)
                {
                                //Retrieve the information about each sheet connector
		DisplayMessage = " Input Routable  : " + RoutableInstance.GetAttributeString("PLM_ExternalID") + " | "  		
		DisplayMessage = DisplayMessage + "Active Sheet Connector Name  = " + SheetCntrInfos.GetAttributeString("SheetConnector_Object_Name")+ " | "  
                              
		Let RelatedOffSheetName(String)
		Let i = 1
		Set ListofRelatedName =  SheetCntrInfos.GetAttributeObject("SheetConnector_RelatedOffSheetObject_Name")
		for i while i<=ListofRelatedName->Size()
		{   
		RelatedOffSheetName = ListofRelatedName[i]
		if (RelatedOffSheetName <> "")
		DisplayMessage = DisplayMessage + " | "  + "Related OffSheet Name=  " + RelatedOffSheetName+ " | "
	                }
		Let RelatedRoutableInstance(PLMCoreInstance)
		Set RelatedRoutableInstance = SheetCntrInfos.GetAttributeObject("SheetConnector_RelatedRoutable")
		if (RelatedRoutableInstance <> NULL)
		DisplayMessage = DisplayMessage  + "Related Routable Instance = "+ RelatedRoutableInstance.GetAttributeString("PLM_ExternalID")+ " | "
		
		Let RelatedComponentInstance(PLMCoreInstance)
		Set RelatedComponentInstance = SheetCntrInfos.GetAttributeObject("SheetConnector_RelatedComponent")
		if (RelatedComponentInstance <> NULL)
		DisplayMessage = DisplayMessage + "Related Component Instance = "+ RelatedComponentInstance.GetAttributeString("PLM_ExternalID")+ " | "
		
		Let SheetInst(DIFSheetInstance)
		Set SheetInst = SheetCntrInfos.GetAttributeObject("SheetConnector_SheetInstance")
		if (SheetInst <> NULL)
		DisplayMessage = DisplayMessage + " | "  + "Sheet Instance = " + SheetInst.GetAttributeString("PLM_ExternalID")
			
		Let Sheet(DIFSheet)
		Set Sheet = SheetCntrInfos.GetAttributeObject("SheetConnector_SheetReference")
		if (Sheet <> NULL)
		DisplayMessage = DisplayMessage + " | "  + "Sheet Reference = " + Sheet.Name+ " | "
		
		Let ViewInstance(DIFViewInstance)
		Set ViewInstance = SheetCntrInfos.GetAttributeObject("SheetConnector_ViewInstance")
		DisplayMessage = DisplayMessage + "View Instance= " + ViewInstance.GetAttributeString("PLM_ExternalID")+ " | "

		Let ViewRef(DIFView)
		Set ViewRef = SheetCntrInfos.GetAttributeObject("SheetConnector_ViewReference")
		DisplayMessage = DisplayMessage + "View Reference= " + ViewRef.Name+ " | "
		
		Let PositionX(Real)
		Set PositionX = SheetCntrInfos.GetAttributeReal("SheetConnector_PositionX_InSheet")
		DisplayMessage = DisplayMessage + " | "+ "PositionX= " + PositionX+ " | "
		
		Let PositionY(Real)
		Set PositionY = SheetCntrInfos.GetAttributeReal("SheetConnector_PositionY_InSheet")
		DisplayMessage = DisplayMessage+ "PositionY=  " + PositionY+ " | "
		
		Let FramePositionX(String)
		Set FramePositionX = SheetCntrInfos.GetAttributeString("SheetConnector_FramePositionX")
		DisplayMessage = DisplayMessage + "FramePositionX=  " + FramePositionX+ " | "
		
		Let FramePositionY(String)
		Set FramePositionY = SheetCntrInfos.GetAttributeString("SheetConnector_FramePositionY")
		DisplayMessage = DisplayMessage + "FramePositionY=  " + FramePositionY+ " | "
		
		Message(DisplayMessage)
                }
}

Results

For the diagram view containing a routable connected to two different sheet connectors, the previous business rule returns the following information.

Input Name
Input Routable Routable_Inst
Output Properties
Active Sheet Connector Name CATSchOnOffSheetSymbol.1
Related OffSheet Name CATSchOnOffSheetSymbol.2
Related Routable Instance Routable_Inst
Related Component Instance Equipement2.1
Sheet Instance Sheet1.1
Sheet Reference Sheet1
View Instance View1.1
View Reference View1
Position X 606.3
Position Y 640
FramePosition X C
FramePosition Y 4
Output Properties
Active Sheet Connector Name CATSchOnOffSheetSymbol.2
Related OffSheet Name CATSchOnOffSheetSymbol.1
Related Routable Instance Routable_Inst
Related Component Instance Equipement1.1
Sheet Instance Sheet2.1
Sheet Reference Sheet2
View Instance View2.1
View Reference View2
Position X 393.7
Position Y 630
FramePosition X B
FramePosition Y 4

ListSymbolReferenceNamesFromPLMReference

This function lets you retrieve the names of the symbol references associated with a given logical reference.

Signature

ListSymbolReferenceNamesFromPLMReference(iPLMReference : PLMReference, PLMCoreReference : PLMCoreReference) : Integer
Name Input/Output Required Type Comment
iPLMReference In PLMCoreReference The logical reference of the object for which the symbol is to be replaced.
oListOfSymbolRefNames Out List The list of symbol references names associated with the input logical reference.

UpdateSchTextTemplatesFromInstances

This function lets you update text templates automatically on a selected instance

Signature

UpdateSchTextTemplatesFromInstances(Instances_To_Update : List, Error_Message : List) : Integer

Arguments

Name Input/Output Required? Type Comment
Instances_To_Update In List Lists of the logical instances for which text template must be updated.
Error_Message Out String Displays an error message as a string for texts that are not updated. For example, if you select views in which objects are placed are not editable, the following message appears: Some views containing symbols of selected instances are not editable, text templates updated partially.

ReturnType

Integer

Update Text Templates for a List of Instances

if(InstanceToUpdateText <> NULL)
{
	let InstanceList(list)
	InstanceList.Append(InstanceToUpdateText)
	let Error(string)
	
	//Call the EKL function to update text for selected instance
	UpdateSchTextTemplatesFromInstances(InstanceList,Error)
	if(Error.Length() > 0)
	{
		Notify(Error)
	}
}

For each instance, the text templates will be updated on the symbols or routes placed in all the views loaded in session.

Notes:
  • Symbols and routes pointing to input instances are searched only in session.
  • Non-editable views are skipped and the text templates within these views are not updated.
  • If you select a routable instance that points to a route ending with sheet connector, the text template on the sheet connector is updated.

UpdateSchTextTemplatesFromSheets

This function lets you update text templates automatically in a sheet.

Signature

UpdateSchTextTemplatesFromSheets(Sheets_To_Update : List, Error_Message : String) : Integer

Arguments

Name Input/Output Required? Type Comment
Sheets_To_Update In List Lists of the sheets instances Or sheet references for which text template update is to be triggered
Error_Message Out String Displays an error message as a string for texts that are not updated. For example, if some views in the selected sheet are not editable, the following message appears: Some views of the selected sheets are not editable, text templates updated partially.

ReturnType

Integer

Update Text Templates for a List of Sheets

if(SheetToUpdateText <> NULL)
{
	let SheetList(list)
	SheetList.Append(SheetToUpdateText)
	let Error(string)
	
	//Call the EKL function to update texts for selected sheet
	UpdateSchTextTemplatesFromSheets(SheetList,Error)
	if(Error.Length() > 0)
	{
		Notify(Error)
	}
}

All the text templates present on symbols or routes in the sheets given as input are updated.

Note: Non-editable views will be skipped, and text templates within these views are not updated.