Approach Angle from Reference FastenerYou can consider the approach angle from a reference fastener for matching data using Orientation Axis. To consider an approach angle from a reference fastener for matching data, select the required axis under Orientation Axis. If you want to lock the Z-Axis orientation and consider an approach angle Rx, Ry from the reference fastener, select the Orientation axis as Z. The following CATRules are in
Input Parameters:
Output Parameters:
Sample EKL script below:
/*
User can specify Matching logic as per his requirement.
Below script shows the sample logic.
INPUT PARAMETERS:
---------------------------------------------------
RefTag - Reference Tag
DiffDistance - Diff Distance in MM
DiffAngle - Diff Angle in RAD
MatchStatus - Default Match status
JoiningPartsMatchStatus - Joining parts match status
OUTPUT PARAMETERS:
---------------------------------------------------
FinalMatchingStatus - Final match status after performing the user logic
MatchingConditionValue - Attribute value that needs to set under the matching tag as as User Attribute
Attribute Name : "Matching Condition".
*/
Let Tag(DNBTag)
Let dDiffDistance(Real)
Let dDiffAngle(Real)
Let MatchingStatus (Integer)
Let JPrtsMatchStatus(Integer)
// INPUTS
Tag=Parameters->GetAttributeObject("RefTag")
dDiffDistance = Parameters->GetAttributeReal ("DiffDistance")
dDiffAngle = Parameters->GetAttributeReal("DiffAngle")
MatchingStatus = Parameters->GetAttributeInteger("MatchStatus")
JPrtsMatchStatus= Parameters->GetAttributeInteger("JoiningPartsMatchStatus")
Let FinalMatch(Integer)
Let AttributeValue(String)
/*
******************************************************************************
Sample scrript shows the override the matching status based on
1. The linear tol ranges,
2. Angular tol range and
3. Computing the Zone Attribute
******************************************************************************
*/
// Linear Tol Range (In MM)
Let lstDiffDistRange(List)
lstDiffDistRange.SetItem(5,1)
lstDiffDistRange.SetItem(15,2)
// Angular Tol Range(In RAD)
Let lstAngleRange(List)
lstAngleRange.SetItem(1.3,1)
lstAngleRange.SetItem(1.4,2)
Let i,j,iCount,jCount (Integer)
iCount = lstDiffDistRange->Size()
for i = 1 while i <= iCount
{
Let tmp(String)
Let curDistDiff(Real)
curDistDiff= lstDiffDistRange[i]
if (dDiffDistance < curDistDiff )
{
FinalMatch =1
tmp = ToString(i)
AttributeValue = tmp
break
}
else if (i == iCount)
{
tmp = ToString(i+1)
AttributeValue = tmp
}
}
jCount = lstAngleRange->Size()
for j = 1 while j <= jCount
{
Let tmp(String)
Let curAngleDiff(Real)
curAngleDiff= lstAngleRange[j]
if(dDiffAngle < curAngleDiff )
{
tmp = ToString(j)
AttributeValue = AttributeValue +tmp
break
}
else if(j ==jCount)
{
tmp = ToString(i+1)
AttributeValue = AttributeValue + tmp
}
}
if(JPrtsMatchStatus == -1)
{
AttributeValue = AttributeValue + "0"
}
else if(JPrtsMatchStatus == 0)
{
FinalMatch =0
AttributeValue = AttributeValue + "1"
}
else
{
AttributeValue = AttributeValue + "2"
}
// OUPUTS -
// Set the Final match and Zone Attribute value to the Output parameters
Parameters->SetAttributeInteger("FinalMatchingStatus", FinalMatch)
Parameters->SetAttributeString("MatchingConditionValue", AttributeValue)
Comparison Computation Flow
The flow chart below shows the BL calls: ![]() ![]() ![]() ![]() Note:
EKL Script runs on each pair after computing using the default logic.
Implement logic to filter or modify the matching status if reference and matching data
cannot be matched, or generate attribute values using the default logic.
Click Auto-Distribute to distribute the fasteners. The
| |||||||