Validate Segment Routing Through Support (EHIRouting_ValidateAddSegmentToSupport)

An opening ID is an entry point used to customize business logic. During the branch routing, the Validate segment routing through support opening ID checks if a specific segment can be added to a support.

This opening ID is available in the Electrical physical system design resources resource set.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This 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:

  • If a segment can be added to a support instance.
  • The compatibility of the segments already routed in the support instance with a new segment.
  • If the support instance is not overloaded.

The opening ID can either:

  • Validate the branch routing to the support (severity=0)
  • Validate the branch routing to the support with a warning message computed from the rules context (severity=1)
  • Forbid the branch routing to the support with a warning message computed from the rules context (severity=2)

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: EHIRouting_ValidateAddSegmentToSupport
Customization intent: Validation
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Branch segment to route. Has a Segment type.
  • Parameters corresponds to the context object.

    A message attribute will be displayed in a warning if the validation fails.

  • Validation
  • Severity messages:
    • Severity= 0: The treatment is to be continued (no message).
    • Severity= 1: The treatment is to be continued and only a warning raised.
    • Severity= 2: The treatment is supposed to be undone.

Context Object Parameters

Parameter NameTypeRead/WriteComments
SupportInstanceVPMInstance ReadInstance of support to be added in branch routing.

Its reference has a SharedSupportPart type.

SupportSectionIntegerReadSupport section number
ListOfSegmentsListReadList of already routed segments in the support's section.

Sample

The 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)
}