General InformationThis opening ID is invoked while using the routing commands. For more information, see Electrical 3D Part Design: Routing Branches. The purpose of this opening ID is to check:
The opening ID can either:
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 how to check if a segment can be added to a support during branch routing. /* CATRule signature (do not edit) : (ThisObject : #In Branch, Parameters
: #In RuleContext, Validation : #Out Boolean) : #Void */
let Support(VPMInstance)
let ListOfSegments(LIST)
let SptName(String)
let Branch(Branch)
let SupportSection(INTEGER)
let sBranchName(STRING)
let bChecked(BOOLEAN)
bChecked = false
Parameters.Severity = 1
Parameters.Message = "EHIRouting_ValidateAddSegmentToSupport Default Message"
Validation = true
set Support = Parameters.GetAttributeObject("SupportInstance")
set ListOfSegments = Parameters.GetAttributeObject("ListOfSegments")
set SupportSection = Parameters.GetAttributeInteger("SupportSection")
SptName = Support.Name
Trace(1, "Validating addition of Support to branch " + ThisObject.Name + "Support = "
+ SptName + "--> Section ",SupportSection)
if((3 == SupportSection) or (5 <= ListOfSegments->Size()))
{
/* Adding support to third section of Support is not allowed*/
/* Adding more than 5 supports is not allowed*/
Validation = false
Parameters.Severity = 2
Parameters.Message = "Addition is not possible on this section of Support"
Trace (1, "Rule FAILED: " + Parameters.Message)
}
else if(2 <= ListOfSegments->Size())
{
/* If 2 segments are already routed show warning */
Validation = true
Parameters.Severity = 1
Parameters.Message = "Warning: Two or more segments is already routed through
this section of Support;"
Trace (1, "EHIRouting_ValidateAddSegmentToSupport Rule succeeded : "
+ Parameters.Message)
}
else
{
/* else Allow routing */
Validation = true
Parameters.Severity = 0
Parameters.Message = "Support Addition is possible"
Trace (1, "EHIRouting_ValidateAddSegmentToSupport Rule succeeded : " + Parameters.Message)
}
| |||||||||||||||||||||||||||||