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
}