Business Rule: CATRule for Compare and Transform for Linear and Angular Tolerances.

You can use a CATRule to verify Business Logic (BL), and specify a range for linear and angular tolerances used during comparison.

This page discusses:

Approach Angle from Reference Fastener

You 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 ..\resources\knowledge\scripts. CATRuleExit is a Configuration file that links to OpeningID, Object type, and CATRule file name. The CATRule is EKL scripting to compute mapping between V5 and 3DX attributes.

DELRobCompareTransform_Comparison.CATRuleExit
The opening ID is DELRobCompareTransform_Comparison and the mode is computation.
DELRobCompareTransform_ComparisonComputation.CATRule
Modify the logic to define the matching status based on this criteria and compute the attribute value accordingly. You can return them by specifying the output parameters.

Input Parameters:

  1. RefTag: Tag.
  2. DiffDistance: Distance between comparing objects.
  3. DiffAngle: Angle between comparing objects.
  4. MatchStatus: Matching status w.r.t default logic.
  5. JoiningPartsMatchStatus: Matching status w.r.t joining parts.

Output Parameters:

  1. FinalMatchingStatus: Final matching status to consider.
  2. MatchingConditionValue: Attribute value(matching condition).

Sample EKL script below:

  1. Using certain logic you can define the matching status between comparison objects.
    • Define a linear/angular tolerance range and compute the attribute accordingly.
    • Example: There are two lists defined – one for linear tolerance range and another for angular tolerance range.

  2. Compute the attribute value for the given pair.
/* 
	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

  1. Default computations for comparisons use the options specified in the GUI (linear tolerance, angular tolerance, flip, etc.).
  2. EKL scripts call on each pair (matched and unmatched) of results from the default computation.
  3. Each pair passes information such as DiffDistance, DiffAngle, Matching Status, and Joining Parts Matching Status to the EKL.
  4. You can implement your own logic to finalize the matching status for a given pair. Also, you can generate attribute values and return them through output parameters.
  5. The final matching status comes from the EKL results. Also, the matching tag receives the attribute value returned.

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 Matching Condition attribute receives the value returned from the Business Rule.