Compute Aggregating Product of Routable (L2P_ComputeFatherForPlacingRoutables)

An opening ID is an entry point used to customize business logic. The Compute Aggregating Product of Routable (L2P_ComputeFatherForPlacingRoutables) opening ID allows to automatically aggregate a logical routable under a specific electrical physical system after the Logical to Physical synchronization.

Important: The business rule is executed only if the Allow instance links between one logical and multiple physical electrical systems option is selected. For more information, see Electrical 3D Design: Synchronizing Physical Data with Logical Data: Synchronizing a Logical System with Several Electrical Physical Systems.
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 during the Synchronize stage of the Logical to Physical command.

DefinitionDescription
PLM Opening IDL2P_ComputeFatherForPlacingRoutables
Customization intent Computation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead or WriteComments
FactTypeAny EKL typeType of ThisObject in the business rule body.
ThisObjectRFLPVPMLogicalInstance ReadLogical system in which the business rule is executed.
L2PListLogicalRoutablesListReadList of logical routables aggregated in a logical system.
L2PListCompatibleFathersListReadList of compatible electrical physical systems.

Output Objects

Parameter NameTypeRead or WriteComments
L2PListofPhysicalFathersList WriteList of physical parents computed for creation corresponding to logical routables in L2PListLogicalRoutables
Notes:
  • If the size of L2PListLogicalRoutables and L2PListofPhysicalFathers are different, the output list is ignored.
  • If you enter a NULL value in one of the output lists (<name of output list>), the first L2PListCompatibleFathers parameter is accounted for.

Sample

The following sample illustrates how to compute the parent for placing a routable, using V_description attribute as criteria. The conductor corresponding to the logical routable is placed in the electrical physical system which has the same V_description attribute.

/* CATRule signature (do not edit) : (ThisObject : #In RFLVPMLogicalInstance, Parameters : #In RuleContext) : #Void */

/* Rule created by KMM1 13-May-16 */ 
let listCompatibleFathers(LIST)
let listRoutables(LIST)
let listComputedFathers (LIST)
let listComputedFatherDescription (LIST)

let occ (ProductOccurrence)
let inst (VPMInstance)
let ref (VPMReference)
let feat (Feature)
let featFather (Feature)
let occLog (LogicalOccurrence)
let instLog (RFLVPMLogicalInstance)
let refLog (RFLVPMLogicalReference)

let index (INTEGER)
let size (INTEGER)
let pos (INTEGER)
let severity (INTEGER)

let sDesc (STRING)
let sMessage1 (STRING)
let sMessage2 (STRING)
let sMessage (STRING)

set severity =2
set listRoutables = Parameters.GetAttributeObject("L2PListLogicalRoutables" )
set listCompatibleFathers = Parameters.GetAttributeObject("L2PListCompatibleFathers") 
if( (NULL <> listRoutables) and (1 <= listRoutables.Size()) )
{
	if( (NULL == listCompatibleFathers) or (0 >= listCompatibleFathers.Size()) )
	{
		set sMessage = "Computation Failed: List of compatible fathers is invalid"
	}
	else // Create list of descriptions of all compatible parents
	{
		set size = listCompatibleFathers.Size()
		set index = 1

		for index while index <= size
		{
			set sDesc = ""
			set feat = listCompatibleFathers.GetItem(index)
			set occ = feat
			set inst  = feat
			set ref = feat
			if(NULL <> occ)
				set ref = occ.Reference
			else if(NULL <> inst)
				set ref = inst.Reference	
			if(NULL <> ref)
			{
				set sDesc  = ref.V_description
			}
			listComputedFatherDescription.Append(sDesc)
		}
		
		/* if the description list is created, for each routable find description and create list father */
		/* NOTE: The criteria could be anything in the rule*/
		set sMessage = "Computation failed"
		if(size == listComputedFatherDescription.Size())
		{
			sMessage1 = "Parent with compatible description value NOT found for : "
			sMessage2 = "Parent with compatible description value found for : "
			set size = listRoutables.Size()
			set index = 1
			for index while index <= size
			{
				set sDesc = ""
				set pos = 0
				set feat = listRoutables.GetItem(index)
				set occLog = feat
				set instLog  = feat
				set refLog = feat
				if(NULL <> occLog)
					set refLog = occLog.Reference
				else if(NULL <> instLog)
					set refLog = instLog.Reference
				if(NULL <> refLog)
				{
					set sDesc  = refLog.V_description
					if(1 <= sDesc.Length())
						set pos = listComputedFatherDescription.IndexOf(sDesc, 1)
					
				}
				
				/* If description is unset or father with same description is not found in compatible list, return the routable itself (wrong element) */
				/* This will force L2P to set default parent - NOTE this is only for test purpose*/
				set featFather = feat
				if(0 == pos)
				{
					set sMessage1 = sMessage1 + feat.Name + " "
				}
				else
				{
					set featFather = listCompatibleFathers.GetItem(pos) 
					set sMessage2 = sMessage2 + feat.Name + " "
				}
				listComputedFathers.Append(featFather)
			}
			set sMessage = sMessage1 + "|" + sMessage2
			set severity = 0
		}
	}
}
else
{
	set sMessage = "Computation failed: Routable list is invalid"
}

Parameters.SetAttributeObject("L2PListofPhysicalFathers", listComputedFathers)
Parameters.SetAttributeInteger("Severity", severity)
Parameters.SetAttributeString("Message", sMessage)