General InformationThis 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.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe 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")
}
| |||||||||||||||||||||