General InformationThis opening ID is invoked when working with the FLEX algorithm. For more information, see Electrical 3D Part Design: Creating Branches: Using the FLEX Algorithm. This opening ID is used to customize the properties of a material to compute the shape of a segment section. The table below provides you with information related to the definition of the Opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe 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) | |||||||||||||||||||||||||||||||||||||||||||||||||