Rule to define a Stamp Symbol(Schematic_ComputeStampingPlacement)

The Schematic_ComputeStampingPlacement opening ID is used to define and place a stamp symbol in a diagram view.

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 the attribute entered in the sheet properties is modified.

Definition Description
PLM Opening ID Schematic_ComputeStampingPlacement
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: DifSheet
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Symbol_Names_In (input) List Read List of string names of every stamping symbol defined under the StampingSymbolSet logical reference.
Symbol_Names_Out(output) List Write List of string names of the output symbols you want to place in the sheet.
Note: Any invalid output symbol is ignored.
Symbol_PositionX (output) List Write List of real values indicating the X positions of their respective symbols.
Symbol_PositionY (output) List Write List of real values indicating the Y positions of their respective symbols.
Symbol_RotationAngle (output) List Write List of real values indicating the rotation angle of their respective symbols.
IsFlip (output) List Write List of boolean values indicating the flip along the X axis of their respective symbols.
Symbol_Scale (output) List Write List of real values indicating the scale of their respective symbol.

Sample

Note:
  • If the opening ID defines new settings for stamps which are already placed in a diagram view, their position, orientation and size will be modified accordingly. For stamps not yet inserted in the diagram view, new instances of the stamp is created.

  • The stamp symbols are always added in the background view of the sheet reference.
  • The opening ID can output multiple instances of the same stamping symbol. In this case, existing instances will be transformed (moved, rotated, scaled), and additional symbols will be created from the stamp symbol reference.

In the following example, the opening ID is defined to place a stamp symbol every time key words like France, Diffusion or NonProtege are found in the Description box of a sheet.

//Notify All Available Symbol Names
let InputSymbols(list)
set InputSymbols = Parameters.GetAttributeObject("Symbol_Names_In")
let symbolName(String)
for symbolName inside InputSymbols
{
	Notify(symbolName)
}

//Declare the output Lists
let OutputSymbols(list)
let OutputSymbolsPosX(list)
let OutputSymbolsPosY(list)
let OutputSymbolsRotation(list)
let OutputSymbolsFlip(list)
let OutputSymbolsScale(list)

//Get The Sheet Properties and monitored attribute/attributes
let sSheetDescr(String)
set sSheetDescr = ThisObject.GetAttributeString("V_description")

let sheetWidth(Real)
let sheetHeight(Real)
sheetWidth =  ThisObject.V_DIFFormatWidth
sheetHeight = ThisObject.V_DIFFormatHeight

//Keyword Found indicators
let France(Real)
let Diffusion(Real)
let Reserve(real)
let NonProtege(Real)
let Conf(Real)
let PropIntel(Real)

//Keyword search process
France = sSheetDescr.Search("France")
Diffusion = sSheetDescr.Search("Diffusion")
Reserve = sSheetDescr.Search("Reserve")
NonProtege = sSheetDescr.Search("NonProtege")
Conf = sSheetDescr.Search("Conf")
PropIntel = sSheetDescr.Search("PropIntel")

if(France >= 0)
{
	//Output symbol called StampingSymbolFrance is used twice for 2 instances
	OutputSymbols.Append("StampingSymbolFrance")
	OutputSymbolsPosX.Append((sheetWidth/2) -25)
	OutputSymbolsPosY.Append(10)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
	
	OutputSymbols.Append("StampingSymbolFrance")
	OutputSymbolsPosX.Append((sheetWidth/2) +50)
	OutputSymbolsPosY.Append(sheetHeight - 20)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}
if(Diffusion  >= 0)
{
	OutputSymbols.Append("StampingSymbolDiffusion")
	OutputSymbolsPosX.Append((sheetWidth/2) -25)
	OutputSymbolsPosY.Append(sheetHeight - 20)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}
if(Reserve  >= 0)
{
	OutputSymbols.Append("StampingSymbolReserve")
	OutputSymbolsPosX.Append((sheetWidth/2)-100)
	OutputSymbolsPosY.Append(sheetHeight - 20)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}
if(NonProtege >= 0)
{
	OutputSymbols.Append("StampingSymbolNonProtege")
	OutputSymbolsPosX.Append((sheetWidth/2) -25)
OutputSymbolsPosY.Append(10)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}
if(Conf >= 0)
{
	OutputSymbols.Append("StampingSymbolConf")
	OutputSymbolsPosX.Append((sheetWidth/2)-100)
	OutputSymbolsPosY.Append(sheetHeight - 20)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}
if(PropIntel >= 0)
{
	OutputSymbols.Append("StampingSymbolPropIntel")
	OutputSymbolsPosX.Append(sheetWidth -90)
	OutputSymbolsPosY.Append(10)
	OutputSymbolsRotation.Append(0)
	OutputSymbolsFlip.Append(FALSE)
	OutputSymbolsScale.Append(1)
}	
//Set the outputs for the BR
Parameters.SetAttributeObject("Symbol_Names_Out", OutputSymbols)
Parameters.SetAttributeObject("Symbol_PositionX", OutputSymbolsPosX)
Parameters.SetAttributeObject("Symbol_PositionY", OutputSymbolsPosY)
Parameters.SetAttributeObject("Symbol_RotationAngle", OutputSymbolsRotation)
Parameters.SetAttributeObject("Is_Flip", OutputSymbolsFlip)
Parameters.SetAttributeObject("Symbol_Scale", OutputSymbolsScale)