Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
SegmentProfile | Integer |
Read | Indicates a segment profile. Possible values:- 0 = none
- 1 = Circle
- 2 = Ellipse
- 3 = Rectangle.
|
ProfileDimension1 | Length | Read | Segment profile first dimension |
ProfileDimension2 | Length | Read | Segment profile first dimension |
SegmentFlexibility | Real | Read | Segment flexibility value |
StartAbscissa | Real | Read | The start abscissa at which computation of material properties are to be started. |
EndAbscissa | Real | Read | The end abscissa at which computation of material properties should end. |
RatioToBend | Real | Write | Computed ratio to bend value for ThisObject segment |
RatioToTwist | Real | Write | Computed ratio to twist value for ThisObject segment. |
Sample
The following sample illustrates the syntax of the business rule.
/* CATRule signature (do not edit) : (ThisObject : #In Segment, Parameters : #In RuleContext) :
#Void */
Let SegmentProfile (INTEGER)
Let nbOfWiresWireGroups (INTEGER)
Let nbOfCoverings (INTEGER)
Let index (INTEGER)
Let Severity (INTEGER)
Let ProfileDimension1 (REAL)
Let ProfileDimension2 (REAL)
Let StartAbscissa (LENGTH)
Let EndAbscissa (LENGTH)
Let SegmentFlexibility (REAL)
Let YoungModulusEquivalent (REAL)
Let RatioToBend (REAL)
Let RatioToTwist (REAL)
Let ListConductors (LIST)
Let ListCoverings (LIST)
Let WireDia (REAL)
Let WireOuterDia (REAL)
Let result (BOOLEAN)
Let Message (STRING)
Let Tape (InternalTapeProtection)
Let Adaptive (InternalAdaptiveProtection)
Let Conductor (Conductor)
Let SectionConductor (REAL)
Let TotalSectionConductor (REAL)
Let TotalYMSection (REAL)
Let TotalSection (REAL)
Let MidSection (REAL)
Let SegmentLength (LENGTH)
Let SegmentExtremity1 (SegmentExtremity)
Let SegmentExtremity2 (SegmentExtremity)
/* Initialize the output */
set YoungModulusEquivalent = 1.24*1e9
set RatioToBend = 1
set RatioToTwist = 0.01
set Severity = 1
set Message = "Default business rule message"
set MidSection = 0.5
/* Possible values (0 = none, 1 = Circle, 2 = Ellipse, 3 = Rectangle) */
set SegmentProfile = Parameters.GetAttributeInteger("SegmentProfile")
set SegmentFlexibility = Parameters.GetAttributeReal("SegmentFlexibility")
set ProfileDimension1 = Parameters.GetAttributeReal("ProfileDimension1")
set ProfileDimension2 = Parameters.GetAttributeReal("ProfileDimension2")
set StartAbscissa = Parameters.GetAttributeReal("StartAbscissa")
set EndAbscissa = Parameters.GetAttributeReal("EndAbscissa")
set SegmentLength = ThisObject.Elec_Length
/* List all wires */
set nbOfWiresWireGroups = 0
ListConductors = ThisObject.IncludedWires
if(NULL <> ListConductors)
set nbOfWiresWireGroups = ListConductors->Size()
if(1 <= nbOfWiresWireGroups)
{
set TotalYMSection = 0.0
set TotalSection = 0.0
result = false
index = 1
for index while index <= nbOfWiresWireGroups
{
set Conductor = ListConductors->GetItem(index)
if(NULL <> Conductor)
{
result = true
WireDia = Conductor.Elec_Diameter
WireOuterDia = Conductor.Elec_OutsideDiameter
SectionConductor = 3.14*(WireDia/2)*(WireDia/2)
TotalSectionConductor = 3.14*(WireOuterDia/2)*(WireOuterDia/2)
TotalYMSection = TotalYMSection + (124*1e11 * SectionConductor + 1.5*1e09*(TotalSectionConductor
-SectionConductor))
TotalSection = TotalSection + TotalSectionConductor
}
}
if( (result == true) and (0.001 <= TotalSection) )
set YoungModulusEquivalent = TotalYMSection/TotalSection
set RatioToBend = 1
set RatioToTwist = 0.01
}
else
{
/* List all protections */
if(0.001 <= SegmentLength)
{
set MidSection = StartAbscissa + (EndAbscissa - StartAbscissa)/2.0
set MidSection = MidSection/SegmentLength
}
result = ThisObject->Elec_BundleSegmentExtremities(SegmentExtremity1, SegmentExtremity2)
if(SegmentExtremity1 <> NULL)
result = ListAllOuterLayerObjects(SegmentExtremity1, MidSection, ListCoverings, 1)
if( NULL <> ListCoverings)
nbOfCoverings = ListCoverings->Size()
if( (1 <= SegmentFlexibility) and (SegmentFlexibility < 2) )
{
if(0 == nbOfCoverings)
set YoungModulusEquivalent = 1.24*1e11
set RatioToBend = 1
set RatioToTwist = 0.01
}
else if( (2 <= SegmentFlexibility) and (SegmentFlexibility < 3) )
{
if(0 == nbOfCoverings)
set YoungModulusEquivalent = 1.24*1e10
set RatioToBend = 1
set RatioToTwist = 0.01
}
else if( (4 <= SegmentFlexibility) and (SegmentFlexibility < 5))
{
if(1 <= nbOfCoverings)
set YoungModulusEquivalent = nbOfCoverings*1.24*1e10
set YoungModulusEquivalent = 1.24*1e8
set RatioToBend = 10
set RatioToTwist = 0.01
}
else if(SegmentFlexibility >= 5)
{
if(1 <= nbOfCoverings)
set YoungModulusEquivalent = nbOfCoverings*1.24*1e10
set YoungModulusEquivalent = 1.24*1e8
set RatioToBend = 100
set RatioToTwist = 0.01
}
}
Parameters.SetAttributeReal("YoungModulusEquivalent", YoungModulusEquivalent)
Parameters.SetAttributeReal("RatioToBend", RatioToBend)
Parameters.SetAttributeReal("RatioToTwist", RatioToTwist)
Parameters.SetAttributeInteger("Severity", Severity)
Parameters.SetAttributeString("Message", Message)