Compute 3D Port (L2P_Compute3DPort)

An opening ID is an entry point used to customize business logic. The Compute 3D Port opening ID is available in the Logical to Physical Assistant Resources resource set.

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 to select or compute a port from the list of 3D ports for input item to be connected to.

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

Input Objects

Input objects must be of the following types:

  • ThisObject: input of L2PItem type which is a unitary item from which the port is to be retrieved for connection.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
ExpectedPort RFLVPMLogicalPort Read RFLVPMLogicalPort which is the Logical Port on ThisObject, for which physical port is to be retrieved.
ListOfPortsOn3DFacet List Read List of ports found on Physical Object of ThisObject. This list will be empty if there are multiple occurrences found in Physical Object. User will have to list ports of desired type in the rule itself.
ListOfOccurrences List Read List of occurrences filled with occurrences found in Physical Object of ThisObject, which are compatible for connection.
ItemToConnect L2PItem Read L2PItem which is to be connected through output port.
OccurrencesToConnect Read/Write Occurrence which should be used for creation of connection through “PortToConnect”. It would be valuated if the only one compatible occurrence was found from Physical Object. In case of multiple compatible occurrences, user should set this parameter with right compatible occurrence.
PortToConnect Feature Write Feature which should be valuated with correct type of Port to be used for connection. For example if the ItemToConnect is an Item for cable, the port should be of Cavity type.

Sample

let listPort (LIST)
let listPortTypes (LIST)
let logPort (RFLVPMLogicalPort)
let sName(STRING)
let sLogName(STRING)
let index (INTEGER)
let physPort (VPMPort)
let computedPort(VPMPort)
let devOcc (ProductOccurrence)
let devRef (VPMReference)
let itemToConnect (L2PItem)
let L2PEqt (L2PItem_Equipment)
let result (Boolean)

set result = false

listPortTypes.Append("Elec3DCavity")
listPortTypes.Append("Elec3DCavityV5")

set L2PEqt = ThisObject
if(NULL <> L2PEqt)
{
	set devOcc = ThisObject.Facet3D
	if(NULL == devOcc)
		set devOcc = L2PEqt.Predefined3DSpace
	if(NULL <> devOcc)
	{
		set logPort = Parameters.GetAttributeObject("ExpectedPort")
		
		set devRef = devOcc.Reference
		if(NULL <> devRef)
		{
			ListElectricalConnectionPoints(devRef, listPortTypes, listPort)
						
			if( (NULL <> logPort) and (1 <= listPort.Size()) )
			{
				set sLogName = logPort.Name
				set sName = "Cavity." + sLogName
				Notify ("Compute3DPort: Device = #, Log Port = #, Computed 3D Port Name = #", devOcc.Name, sLogName, sName)
				set index = 1
				for  index while index <= listPort.Size()
				{
					set physPort = listPort.GetItem(index)
					if( (NULL <> physPort) and (sName == physPort.V_FunctionalName) )
					{
						computedPort = physPort
					}
				}
			}
			if(NULL <> computedPort)
			{
				Notify ("Compute3DPort = #", computedPort.V_FunctionalName)
				Parameters.SetAttributeObject("PortToConnect", computedPort)
				Parameters.Message = "Port computed successfully"
				Parameters.Severity = 1
				result = true
			}
		}
	}
}
if(false == result)
{
	Parameters.Message = "Port computation FAILED"
	Parameters.Severity = 2
}