Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
ConductorBeingRouted | Conductor |
Read | The conductor being routed. |
ListAlreadyPassingConductors | List | Read | List of conductors or cable routes already passing through this
segment. |
MaximumFillingRatio | Real | Read | The maximum filling ratio value defined for this segment. The value can be defined using the Maximum Filling Ratio percentage option in your preferences, or using the User Filling ratio option in the Conductor Routing Assistant preferences. For more information, see Electrical 3D Design User's Guide: Routing Conductors: Working with the Conductor Routing Assistant: About Conductor Routing Assistant. |
Sample 1
The following sample explains how to use an opening ID to check segment loading, and to look for an alternate path to route the conductor through it.
Let cond(Conductor)
Let ExistingCondList(List)
Let str(String)
Let nbExistingCond(Integer)
Let SegName(String)
Validation = true
Parameters.Severity = 0
Set cond = Parameters.GetAttributeObject("ConductorBeingRouted")
Set str = ThisObject.Elec_Segreg
Set SegName = ThisObject.Name
Set ExistingCondList = Parameters.GetAttributeObject("ListAlreadyPassingConductors")
Set nbExistingCond = ExistingCondList.Size()
if("1" == str)
{
if(nbExistingCond >= 1)
{
Parameters.Severity = 2
Parameters.Message = SegName + " is overloaded"
Validation = false
}
if(nbExistingCond == 0)
{
Parameters.Severity = 1
Parameters.Message = SegName + " is almost full"
Validation = true
}
}
Sample 2
The following sample explains how to use the opening ID to validate a conductor's
route based on the filling ratio of the segments.
Let cond(Conductor)
Let ExistingCondList(List)
Let str(String)
Let SegName(String)
Let MaxFR(Real)
Let CurrFR(Real)
Validation = true
Parameters.Severity = 0
Set str = ThisObject.Elec_Segreg
Set SegName = ThisObject.Name
ThisObject.Elec_FillingRatio(CurrFR)
CurrFR = CurrFR * 100;
Set cond = Parameters.GetAttributeObject("ConductorBeingRouted")
Set ExistingCondList = Parameters.GetAttributeObject("ListAlreadyPassingConductors")
set MaxFR= Parameters.GetAttributeReal("MaximumFillingRatio")
if("Reinforced" == str)
{
if(CurrFR >= MaxFR)
{
Parameters.Severity = 1
Parameters.Message = SegName + " is overloaded but allowed routing as this cableway is reinforced"
Validation = true
Notify("segment is overloaded but allowed routing as this cableway is reinforced")
}
}
else
{
if(CurrFR >= MaxFR)
{
Parameters.Severity = 2
Parameters.Message = SegName + " is overloaded"
Validation = false
}
}
Sample 3
The following sample illustrates how to validate the route of a cable.
Let cableRoute(ElecRoute)
Let ExistingCondList(List)
Let SegName(String)
Let MaxFR(Real)
Let CurrFR(Real)
Notify("Segment Validation BR")
Validation = true
Parameters.Severity = 0
Set SegName = ThisObject.Name
ThisObject.Elec_FillingRatio(CurrFR)
CurrFR = CurrFR * 100
Set cableRoute = Parameters.GetAttributeObject("RouteBeingModified")
Set ExistingCondList = Parameters.GetAttributeObject("ListAlreadyPassingConductors")
set MaxFR= Parameters.GetAttributeReal("MaximumFillingRatio")
Notify("Current Filling Ratio : " + CurrFR)
Notify("Maximum Filling Ratio : " + MaxFR)
if(CurrFR >= MaxFR)
{
Parameters.Severity = 2
Parameters.Message = SegName + " is overloaded"
Validation = false
Notify("segment is overloaded")
}
else
{
Parameters.Severity = 0
Parameters.Message = SegName + " is allowed"
Validation = true
Notify("segment is allowed")
}