Compute Values of Additional Attributes in Cable Manager (EWR_ListAdditionalAttributeValuesForCableManager)

An opening ID is an entry point used to customize business logic. The Compute Values of Additional Attributes in Cable Manager opening ID is available in the Electrical physical system design resources set. This opening ID allows to compute the attributes displayed in the additional columns in the Cable Manager Assistant panel.

Important: The Compute Additional Attributes in Cable Manager opening ID must be customized before using this opening ID. For more information, see Compute Additional Attributes in Cable Manager (EWR_ListAdditionalAttributesForCableManager).
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 you synchronize your cable routes information with your cables in the Cable Management command.

For more information, see Electrical 3D Design User's Guide: Synchronizing Cables with Cable Routes.

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

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
FactType Any EKL type Type of ThisObject in the business rule body.
ListAttributesForRoutes List Read List of additional attribute names for Routes for which value has to be retrieved.
ListAttributesForCables List Read List of additional attribute names for Cables for which value has to be retrieved.
ListRoutes List Read List of routables (cable route) for which additional attribute values have to be retrieved.
ListCables List Read List of routables (Electrical cable) for which additional attribute values have to be retrieved.
ListAttributeValuesForRoutes List Write List of attribute values for cable routes
ListAttributeValuesForCables List Write List of attribute values for cables

Sample

let ListInputRoutable(LIST)
let ListAttr(LIST)
let ListListAttrValues(LIST)
let ListAttrValues(LIST)

let ListInputRoutable2(LIST)
let ListAttr2(LIST)
let ListListAttrValues2(LIST)
let ListAttrValues2(LIST)

let currentObj (Feature)
let route (ElecRoute)
let cable (Elec3DCable_Inst)
let cableRef(Elec3DCable)

let index (INTEGER)
let index2 (INTEGER)

let strAttr(STRING)

let routeLen(LENGTH)
let condMass(MASS)


set ListInputRoutable = Parameters.GetAttributeObject("ListRoutes")

ListAttr =  Parameters.GetAttributeObject("ListAttributesOfRoutes")
ListListAttrValues =  Parameters.GetAttributeObject("ListAttributeValuesForRoutes")

set ListInputRoutable2 = Parameters.GetAttributeObject("ListCables")
ListAttr2 =  Parameters.GetAttributeObject("ListAttributesOfCables")
ListListAttrValues2 =  Parameters.GetAttributeObject("ListAttributeValuesForCables")

if (NULL <> ListInputRoutable)
{
	index = 1
	for index while index <= ListInputRoutable.Size()
	{
		set currentObj = ListInputRoutable.GetItem(index)
		set route = currentObj
		ListAttrValues.RemoveAll()	

		index2 = 1
		for index2 while index2 <= ListAttr.Size()
		{
			set strAttr = ListAttr.GetItem(index2)
			if(strAttr == "Name")
			{
				if(NULL<>route)
					ListAttrValues.Append(route.Name)
				else ListAttrValues.Append("NotFound")
			}
			else if(strAttr == "Comment")
			{
				if(NULL<>route)
					ListAttrValues.Append("OK")
				else  ListAttrValues.Append("NotFound")

			}
			else if(strAttr == "Length")
			{
				routeLen = 0mm
				ListAttrValues.Append(routeLen)				
			}
			else ListAttrValues.Append("NA")
		}
		
		ListListAttrValues.Append(ListAttrValues)
	}
}

if (NULL <> ListInputRoutable2)
{
	index = 1
	for index while index <= ListInputRoutable2.Size()
	{
		set currentObj = ListInputRoutable2.GetItem(index)
		set cable = currentObj
		set cableRef = cable.Reference
		ListAttrValues2.RemoveAll()	

		index2 = 1
		for index2 while index2 <= ListAttr2.Size()
		{
			set strAttr = ListAttr2.GetItem(index2)
			if(strAttr == "Name")
			{
				if(NULL<>cable)
				{
					ListAttrValues2.Append(cable.Name)
				}
				else ListAttrValues2.Append("NotFound")
			}
			else if(strAttr == "Sub Type")
			{
				ListAttrValues2.Append("NotFound")
			}
			else if(strAttr == "Length")
			{
				routeLen = cableRef.V_Elec_Length
				ListAttrValues2.Append(routeLen)				
			}
			else ListAttrValues2.Append("NA")
		}
		
		ListListAttrValues2.Append(ListAttrValues2)
	}
}

if(ListListAttrValues.Size() <> ListInputRoutable.Size())
{
	 Parameters.SetAttributeInteger("severity", 2)
	 Parameters.SetAttributeString("Message", "Computation Failed!")
}
else if(ListListAttrValues2.Size() <> ListInputRoutable2.Size())
{
	 Parameters.SetAttributeInteger("severity", 2)
	 Parameters.SetAttributeString("Message", "Computation Failed!")
}
else
{
 	Parameters.SetAttributeInteger("severity", 0)
	 Parameters.SetAttributeObject("ListAttributeValuesForRoutes", ListListAttrValues)
	 Parameters.SetAttributeObject("ListAttributeValuesForCables", ListListAttrValues2)
}