Validate Segment Profile Modification (EHI_ValidateSegmentProfileModification)

An opening ID is an entry point used to customize business logic. The Validate Segment Profile Modification (EHI_ValidateSegmentProfileModification) opening ID validates the edition of a segment's profile based on a specified criteria.

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 whenever you edit the type or the dimensions of a segment profile using:

  • Classic Branch Definition
  • Immersive Branch Definition

If the profile edition is validated, the design of the segment is updated in the 3D area. If not, a warning message appears and the design of the segment is not modified.

Important: The validation is possible only if the Diameter and bend radius to its content option is cleared.

For more information, see Native Apps Preferences Guide: Equipment: Electrical Discipline: Electrical 3D Design: Conductor Routing.

DefinitionDescription
PLM Opening IDEHI_ValidateSegmentProfileModification
Customization intent Validation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject: the segment whose profile is edited.
  • Parameters corresponds to the context object.
  • Validation: if the validation returns TRUE, the design of the segment is updated. If it returns FALSE, the design of the segment is not modified and a warning message appears.

Context Object Parameters

Parameter NameTypeRead or WriteComments
FactTypeAny EKL typeType of ThisObject in the business rule.
New_Segment_ProfileElecProfileReadManages every type of profile.

Sample

The following sample illustrates how to validate the modification of a segment profile. In this example, some specific criteria of the new profile are checked before the validation of the profile modification.

The profile type of the segment is retrieved using the Segment.GetProfile() method. For more information, see Electrical 3D Part Design User's Guide: Reference Information: Knowledge Packages: Electrical Methods.

/* CATRule signature (do not edit) : (ThisObject : #In Segment, Parameters 
 : #In RuleContext, Validation : #Out Boolean) : #Void */

let EleSegment(segment)
 
let strProfileType(string)
let strCorner(string)

let dArea(AREA)
let dim1(LENGTH)
let dim2(LENGTH)
let dim3(LENGTH)
let dim4(LENGTH)

let newProfile(ElecProfile)
let currentProfile(ElecProfile)
let CircleProfile(ElecCircularProfile)
let EllipseProfile(ElecEllipticalProfile)
let RectangleProfile(ElecRectangularProfile)
let TruncRectangleProfile(ElecTruncatedRectangularProfile)

let ModificationStatus(boolean)


// Check New Profile
set newProfile = Parameters.GetAttributeObject("New_Segment_profile")
set strProfileType = newProfile.Elec_ProfileType
set dArea = newProfile.Elec_ProfileArea

ModificationStatus = FALSE
if(strProfileType == "Ellipse")
{
	set EllipseProfile = newProfile
	dim1 = EllipseProfile.Elec_MajorAxis
	if(dim1 >= 10mm)
		ModificationStatus = TRUE
}
else if(strProfileType == "Circle")
{
	set CircleProfile = newProfile
	dim1 = CircleProfile.Elec_Diameter
	if(dim1 >= 10mm)
		ModificationStatus = TRUE
}
else if(strProfileType == "Rectangle")
{
	set RectangleProfile = newProfile
	dim1 = RectangleProfile.Elec_Width
	dim2 = RectangleProfile.Elec_Height
	if(dim1 >= 10mm)
		ModificationStatus = TRUE
}
else if(strProfileType == "TruncatedRectangle")
{
	set TruncRectangleProfile = newProfile
	strCorner = TruncRectangleProfile.Elec_CornerPosition
	if(strCorner == "BOTTOM_RIGHT")
		ModificationStatus = TRUE
}

// Check current profile
if(ModificationStatus == TRUE)
{
	set ModificationStatus = FALSE
	set EleSegment = ThisObject
	EleSegment.GetProfile(currentProfile)
	
	set strProfileType = currentProfile.Elec_ProfileType
	set dArea = currentProfile.Elec_ProfileArea
	
	if(strProfileType == "Ellipse")
	{
		set EllipseProfile = currentProfile
		dim1 = EllipseProfile.Elec_MajorAxis
		if(dim1 >= 10mm)
			ModificationStatus = TRUE
	}
	else if(strProfileType == "Circle")
	{
		set CircleProfile = currentProfile
		dim1 = CircleProfile.Elec_Diameter
		if(dim1 >= 10mm)
			ModificationStatus = TRUE
	}
	else if(strProfileType == "Rectangle")
	{
		set RectangleProfile = currentProfile
		dim1 = RectangleProfile.Elec_Width
		dim2 = RectangleProfile.Elec_Height
		if(dim1 >= 10mm)
			ModificationStatus = TRUE
	}
	else if(strProfileType == "TruncatedRectangle")
	{
		ModificationStatus = TRUE
		set TruncRectangleProfile = currentProfile
		dim1 = TruncRectangleProfile.Elec_MajorHeight
		dim2 = TruncRectangleProfile.Elec_MajorWidth
		dim3 = TruncRectangleProfile.Elec_MinorHeight
		dim4 = TruncRectangleProfile.Elec_MinorWidth
		
		strCorner = TruncRectangleProfile.Elec_CornerPosition
		if( (strCorner <> "TOP_LEFT")  OR (dim1 <= 10mm) OR (dim2 <= 10mm) OR (dim3 == 0mm) OR (dim4 == 0mm) )
			ModificationStatus = FALSE
	}
}

if(ModificationStatus == TRUE)
{
	Parameters.Severity = 0		
	Parameters.Message = "Modification Allowed"		
	Validation = true
}
else
{
	Parameters.Severity = 2		
	Parameters.Message = "Modification Not Allowed"		
	Validation = true
}