Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
ElecInstance1 | PLM Entity |
Read | first electrical Instance to connect |
ElecPort1 | PLM Entity | Read | port of first instance to connect |
ElecInstance2 | PLM Entity | Read | second electrical Instance to connect (can be null if connection of splice on bundle segment splice connection point) |
ElecBundleSegment | PLM Entity | Read | second electrical bundle segment to connect (can be null if connection on device instance) |
ElecPort2 | PLM Entity | Read | port of second instance to connect (can be null if connection to bundle segment splice connection point) |
ElecSpliceConnectionPoint2 | PLM Entity | Read | SpliceConnectionPoint of bundle segment to connect (can be null if connection on device instance) |
Sample 1
The following sample explains how to implement an opening ID to manage the connection between devices.
let SubType1(STRING)
let SubType2(STRING)
let SIC1(Elec3DSingleInsertConnector)
let SIC2(Elec3DSingleInsertConnector)
let SIC1Inst(VPMInstance)
let SIC2Inst(VPMInstance)
set SIC1Inst = Parameters->GetAttributeObject("ElecInstance1")
set SIC2Inst = Parameters->GetAttributeObject("ElecInstance2")
if ( SIC1Inst <> NULL )
{
set SIC1=SIC1Inst.Reference
}
if ( SIC2Inst <> NULL )
{
set SIC2=SIC2Inst.Reference
}
if((SIC1 <> NULL) and (SIC2 <> NULL))
{
SubType1 = SIC1.V_Elec_SubType
SubType2 = SIC2.V_Elec_SubType
if(("" == SubType1) OR ("" == SubType2))
{
Validation = true
Parameters.Severity = 1
Parameters.Message = "Warning : SubType Attributes are not set on one or both devices; Continue?"
Trace (1, "Rule succeeded with Warning : " + Parameters.Message)
}
else if(SubType1 <>SubType2)
{
Validation = false
Parameters.Severity = 2
Parameters.Message = "Error: SubType Attributes Not matched, connection forbidden"
Trace (1, "Rule Failed Error : " + Parameters.Message)
}
else
{
Validation = true
Parameters.Severity = 0
Parameters.Message = "Business Rule allows this Connection"
}
}
Sample 2
The following sample explain how to implement an opening ID to manage the connection between a splice and a segment.
let SubType1(STRING)
let SubType2(STRING)
let Splice1(Elec3DSplice)
let SegmentToConnect(Segment)
let Splice1Inst(VPMInstance)
set SegmentToConnect = Parameters->GetAttributeObject("ElecBundleSegment")
if ( SegmentToConnect <> NULL )
{
set Splice1Inst = Parameters->GetAttributeObject("ElecInstance1")
if ( Splice1Inst <> NULL )
{
set Splice1=Splice1Inst.Reference
}
}
if((Splice1 <> NULL) and (SegmentToConnect <> NULL))
{
Trace (1, "1 - " + Splice1.PLM_ExternalID + " 2 - " + SegmentToConnect.Name)
SubType1 = Splice1.V_Elec_SubType
SubType2 = SegmentToConnect.Elec_SubType
Trace (1, "1 - " + SubType1 + " " + "2 - " + SubType2)
if(("" == SubType1) OR ("" == SubType2))
{
Validation = true
Parameters.Severity = 1
Parameters.Message = "Warning : SubType Attributes are not set on one or both devices; Continue?"
Trace (1, "Rule succeeded with Warning : " + Parameters.Message)
}
else if(SubType1 <>SubType2)
{
Validation = false
Parameters.Severity = 2
Parameters.Message = "Error: SubType Attributes Not matched, connection forbidden"
Trace (1, "Rule Failed Error : " + Parameters.Message)
}
else
{
Validation = true
Parameters.Severity = 0
Parameters.Message = "Business Rule allows this Connection"
}
}