Fastener Compute Occurence Path (FstComputeOccurencePath)

An opening ID is an entry point used to customize business logic.

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 each time an occurence is selected.

This opening ID is used to customize the selection of parts defining the stacking.

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

Opening ID: Fastener Compute Occurence Path
Customization intent: Computation
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject corresponds to the original occurence.

Context Object Parameters

Parameter Name Type Read/Write Comments
ReturnedOcc ObjectType Read Returns the occurrence computed from the input occurrence.

Sample

The following sample returns the owner part of the input occurrence if any, or the input occurrence.

/* M2P 11/30/2013 */
let thisOcc(ProductOccurrence)
let initObjOcc(ProductOccurrence)
let thisOccAux(ProductOccurrence)
let thisRef(ProductOccurrence)
let thisResult(ProductOccurrence)
let i(Integer)
let attr(String)
let returnObj(Feature)
let ReturnedObject(Feature)

/*put into attr the name of the attribute*/
attr = "V_description"
i = 0
thisOcc = ThisObject
initObjOcc = ThisObject
/*iterate on each owner of the part to find the one with the attribute attr*/
for i while thisOcc <> NULL AND thisResult == NULL
{
	thisRef = thisOcc.Reference
	if(thisRef <> NULL)
	{
	    /*Check if the attribut is defined*/
		if(thisRef.GetAttributeString(attr) == "ReturnThis")
		{
			thisResult = thisOcc
		}
		else
		{
			if thisOcc.HasAttribute("Owner")
			{
				set thisOccAux = thisOcc.Owner
				thisOcc = thisOccAux
			}
			else
				thisOcc = NULL
		}
	}	
}

if(thisResult <> NULL)
	returnObj = thisResult	
else
	{
		if thisOcc <> NULL
			returnObj = thisOcc
		else
			returnObj =initObjOcc
	}
/*Return the found attribute*/
if Parameters.HasAttribute("ReturnedObject")
{
	Parameters.SetAttributeObject("ReturnedObject",returnObj)
	ReturnedObject = Parameters.GetAttributeObject("ReturnedObject")
}