General InformationThe table below provides you with information related to the definition of the opening ID.
Input ObjectsInput objects must be of the following type:
Context Object Parameters
Sample
/* ----------------- */
/* Declare Variables */
/* ----------------- */
Let strAttrValue(String)
Let strAttributeID(String)
Let ReturnMessage(String)
Let Value(Real)
Let AttrRealValue(Real)
Let AttrMKSValue(Real)
Let Diameter(Real)
Let Depth(Real)
Let ItemReference(DELFmiFunctionReference)
Validation = true
ReturnMessage = ""
/* ------------------------ */
/* Get the inputs to the BL */
/* ------------------------ */
strAttributeID = Parameters->GetAttributeString("AttributeID")
strAttrValue = Parameters->GetAttributeString("AttributeValueString")
AttrRealValue = Parameters->GetAttributeReal("AttributeValueReal")
AttrMKSValue = Parameters->GetAttributeReal("AttributeValueMKS")
ItemReference = ThisObject
if (strAttributeID == "V_description")
{
if (strAttrValue == "Yes")
{
Validation = true
ReturnMessage = "The business logic allow edition"
}
else
{
Validation = false
ReturnMessage = "The business logic does not allow edition"
}
}
/* All kinds of Holes */
/* Diameter and depth must be positive */
else if (strAttributeID == "V_DiameterOfFeature" OR strAttributeID == "V_DepthOfFeature")
{
if (AttrRealValue <= 0)
{
Validation = false
ReturnMessage = strAttributeID+" Must Be Positive"
}
}
/* COUNTERSUNK */
/* CSAngle > 0 and < 180 deg */
else if (strAttributeID == "V_CSAngle")
{
if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
{
Validation = false
ReturnMessage = strAttributeID+" Must Be Between Zero And PI"
}
}
/* TAPERED */
/* V_TAngle > 0 and < 180 deg */
else if (strAttributeID == "V_TAngle")
{
if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
{
Validation = false
ReturnMessage = strAttributeID+" Must Be Between Zero And PI"
}
}
/* BOTTOM ANGLE */
/* V_BottomAngle > 0 and < 180 deg */
else if (strAttributeID == "V_BottomAngle")
{
if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
{
Validation = false
ReturnMessage = strAttributeID+" MustBeBetweenZeroAndPI"
}
}
/* THREADED */
/* V_THPitch must be positive */
/* V_THDiameter must be greater than Diameter, V_THDepth must be greater than Depth */
else if (strAttributeID == "V_THDiameter" OR strAttributeID == "V_THDepth" OR strAttributeID == "V_THPitch")
{
if (ItemReference <> NULL)
{
set Diameter = ItemReference.GetAttributeReal ("V_DiameterOfFeature" )
set Depth = ItemReference.GetAttributeReal ("V_DepthOfFeature" )
}
if (AttrRealValue < 0 AND (strAttributeID == "V_THPitch" OR strAttributeID == "V_THDepth"))
{
Validation = false
ReturnMessage = strAttributeID+" Must Be Positive"
}
if (strAttributeID == "V_THDiameter" AND Value <= Diameter)
{
Validation = false
ReturnMessage = strAttributeID+"MustBeGreaterThanDiameter"
}
if (strAttributeID == "V_THDepth" AND Value > Depth)
{
Validation = false
ReturnMessage = strAttributeID+" Must Be Lower Than Depth"
}
}
else
{
ReturnMessage = "no rules for attribute"
}
Parameters.SetAttributeString("Message",ReturnMessage)
Parameters.SetAttributeBoolean("oAttributeValidation" , Validation)
| |||||||||||||||||||||||||||||||||||||||