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", "")
}