Validation Rule of a Face Transfer (CCV_TransferValidation )

An opening ID is an entry point used to customize business logic. Validation rule of a face transfer validates the local transfer of a face from one area to another.

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:

  • When a face is transferred locally.

This opening ID is used to customize:

  • The validation of local transfer.
  • The management of local transfer errors.

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

PLM Opening ID: CCV_TransferValidation
Customization intent: Validates locally the transfer of a face
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.
  • Validation

Context Object Parameters

Parameter Name Type Read/Write Comments
IndexSlider Integer Read Index of the pulling direction:
  • 0: Main pulling direction
  • n: nth secondary pulling direction
DraftAngle Integer Read Value of the draft angle
SurfaceArea String Read Area of the faces
ListAngles List Read Angles between the facets normal and the pulling direction.
NaturalDestination Integer Read Computed destination of the face.
ForcesDestination Integer Read Manually assigned destination.
Validation Bolean Write
ErrorMessage String Write Error message
ErrorLevel Integer Write Severity of the transfer error:
  • 0: The transfer is validated.
  • 1: A warning message is displayed.
  • 2: An error message is displayed.

Sample

Let naturalDestination(Integer)
Let forcedDestination(Integer)

Let CavitySide(Integer)
Let CoreSide(Integer)
Let OtherSide(Integer)
Let NoDraftSide(Integer)
Let UndercutSide(Integer)
Let SliderSide(Integer)

CavitySide = 1
CoreSide = 2
OtherSide = 3
NoDraftSide = 4
UndercutSide = 5
SliderSide = 6

naturalDestination = Parameters.GetAttributeInteger("NaturalDestination")
forcedDestination = Parameters.GetAttributeInteger("ForcedDestination")

Parameters.SetAttributeInteger("ErrorLevel", 0)
Validation = true

if(naturalDestination == CavitySide And forcedDestination == CoreSide)
{
                Parameters.SetAttributeInteger("ErrorLevel", 2)
                Parameters.SetAttributeString("ErrorMessage", "A transfer between the Cavity and the Core side is not possible.")
                Validation = false
}
if(naturalDestination == CoreSide And forcedDestination == CavitySide)
{
                Parameters.SetAttributeInteger("ErrorLevel", 2)
                Parameters.SetAttributeString("ErrorMessage", "A transfer between the Core and the Cavity side is not possible.")
                Validation = false
}
if(naturalDestination == OtherSide And forcedDestination == CavitySide)
{
                Parameters.SetAttributeInteger("ErrorLevel", 1)
                Parameters.SetAttributeString("ErrorMessage", "A transfer between the Other and the Cavity side is dangerous.")
}
if(naturalDestination == OtherSide And forcedDestination == CoreSide)
{
                Parameters.SetAttributeInteger("ErrorLevel", 1)
                Parameters.SetAttributeString("ErrorMessage", "A transfer between the Other and the Core side is dangerous.")
}