Validation Rule of a Pulling Direction (CCV_PullingDirectionValidation)

An opening ID is an entry point used to customize business logic. Validation Rule of a Pulling Direction validates the pulling direction.

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 to validate a pulling direction (main or secondary pulling direction).

This opening ID is used to customize the validation of a pulling direction.

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

PLM Opening ID: CCV_PullingDirectionValidation
Customization intent: Validation
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
ListArea List Read List of the areas
ListAngles List Read Angles between the facets normal and the pulling direction.
ErrorMessage String Write Error message
ErrorLevel Integer Write Severity of the transfer error:
  • 0: The pulling direction is validated.
  • 1: A warning icon is displayed on the symbol of the pulling direction.
  • 2: An error icon is displayed on the symbol of the pulling direction.

Sample

/* Declaration of variables */
Let CavitySide(Integer)
Let CoreSide(Integer)
Let OtherSide(Integer)
Let NoDraftSide(Integer)
Let UndercutSide(Integer)
Let SliderSide(Integer)

Let IndexFace(Integer)

Let IndexSlider(Integer)
Let FacesAnglesToPullingDirection(List)
Let FacesAreas(List)
Let DraftAngle(ANGLE)

Let LimiteWarning(FORCE)
Let LimiteError(FORCE)
Let ForceOnSlider(FORCE)
Let FaceForceOnSlider(FORCE)
Let PressionInjection(PRESSURE)

Let MyMessage(String)
Let AngleValue(Real)
Let AreaValue(Real)
Let cosinusFactor(Real)

/* Static variables */
CavitySide = 1
CoreSide = 2
OtherSide = 3
NoDraftSide = 4
UndercutSide = 5
SliderSide = 6

/* Variables of computation opening */
PressionInjection = 10000kg_s2_m1
LimiteWarning = 9mxkg_s2
LimiteError = 10mxkg_s2
ForceOnSlider = 0mxkg_s2

/* Business rule parameters */
IndexSlider = Parameters.GetAttributeInteger("IndexSlider")
set FacesAnglesToPullingDirection = Parameters->GetAttributeObject("ListAngles")
set FacesAreas = Parameters->GetAttributeObject("ListArea")
DraftAngle= Parameters.GetAttributeReal("DraftAngle")*1deg

If(IndexSlider > 0)
{
                /* Loop of angle analyses 
                Three types of angles:
                - Angles not impacted by friction: Angle < 90 - DraftAngle OU > 270 + DraftAngle
                - Angles impacted by friction: Angle (> 90 - DraftAngle ET  < 90 + DraftAngle) OU (> 270 - DraftAngle ET  < 270 + DraftAngle)
                - Blocking angles: Angle < 270 - DraftAngle ET > 90 + DraftAngle
                */

                ForceOnSlider = 0mxkg_s2
                MyMessage = ""
                IndexFace = 1
                For IndexFace while IndexFace <= FacesAnglesToPullingDirection.Size() And IndexFace <= FacesAreas.Size()
                {
                               set AngleValue = FacesAnglesToPullingDirection.GetItem(IndexFace)
                               set AreaValue = FacesAreas.GetItem(IndexFace)
                               
                               cosinusFactor = abs( cos(AngleValue * 1deg) )
                               
                               FaceForceOnSlider = PressionInjection * AreaValue * 1mm2 * cosinusFactor
                               ForceOnSlider = ForceOnSlider + FaceForceOnSlider
                               
                               IndexFace = IndexFace + 1
                }
                
                /* Output analysis */
                if(ForceOnSlider > LimiteError)
                {
                               MyMessage = "Slider cannot resist the plastic pressure. The plastic injection strength (" +ForceOnSlider + ") is over the value tolerated (" + LimiteError + ")."
                               Validation = false
                               Parameters.SetAttributeInteger("ErrorLevel", 2)
                               Parameters.SetAttributeString("ErrorMessage", MyMessage)
                }
                else if(ForceOnSlider > LimiteWarning)
                {              
                               MyMessage = "The plastic injection strength (" +ForceOnSlider + ") is over the warning value (" + LimiteWarning + "). This slider will require a cam pin or a heel block to be secured."
                               Validation = true
                               Parameters.SetAttributeInteger("ErrorLevel", 1)
                               Parameters.SetAttributeString("ErrorMessage", MyMessage)
                }
                else
                {
                               Validation = true
                               Parameters.SetAttributeInteger("ErrorLevel", 0)
                               Parameters.SetAttributeString("ErrorMessage", "")
                }
}
else

{
                Validation = true
                Parameters.SetAttributeInteger("ErrorLevel", 0)
                Parameters.SetAttributeString("ErrorMessage", "")
}