Context Object Parameters
Parameter Name |
Type |
Read or Write |
Comments |
PhysicalRoot |
ProductOccurrence |
Read |
- |
PhysicalParent |
ProductOccurrence |
Write |
- |
Sample
let PhysRootElem(VPMReference)
let rootOcc(ProductOccurrence)
let ChildInstance(VPMInstance)
let ChildReference(VPMReference)
let Instance(VPMInstance)
Let ProductOccurrence1 (ProductOccurrence)
let listChild(LIST)
let nbChild(INTEGER)
let index(INTEGER)
let listChild2(LIST)
let nbChild2(INTEGER)
let index2(INTEGER)
let sName(STRING)
let sRootName(STRING)
let sInstName(STRING)
let sSearchID(STRING)
let sSearchIDTitle(STRING)
let sSearchIDName(STRING)
let sMessage(STRING)
let Child(Feature)
let bParentFound(BOOLEAN)
let thefeature(Feature)
let physicalOcc(ProductOccurrence)
let physicalInst(VPMInstance)
let logocc(LogicalOccurrence)
let loginst(RFLVPMLogicalInstance)
set bParentFound = false
set rootOcc = Parameters.GetAttributeObject("PhysicalRoot")
set PhysRootElem = rootOcc.Reference
set sMessage ="Input enitity type is Unknown"
set logocc = ThisObject.Facet2D
set loginst = logocc.Instance
set sInstName = loginst.Name
set sSearchIDTitle = "Equ_1"
set sSearchIDName = "Equ_1"
if(0 <= sInstName.Search("Prd2"))
{
set sSearchIDTitle = "Equ_2.1"
set sSearchIDName = "Equ_2.1"
}
if( (NULL <> PhysRootElem) and (sSearchIDTitle <> "") and (sSearchIDName <> "") )
{
listChild = rootOcc.Children
if(listChild <> NULL)
{
index = 1
set nbChild = listChild->Size()
for index while index <= nbChild
{
set Child = listChild->GetItem(index)
if( (Child <> NULL) and (bParentFound == false) )
{
sName = ""
set ProductOccurrence1 = Child
if(ProductOccurrence1 <> NULL)
set Instance = ProductOccurrence1.Instance
if(NULL <> Instance)
{
sName = Instance.PLM_ExternalID
}
if( (0 <= sName.Search(sSearchIDTitle, 0, true)) or (0 <= sName.Search(sSearchIDName, 0, true)) )
{
bParentFound = true
Parameters.SetAttributeObject("PhysicalParent", ProductOccurrence1)
Parameters.SetAttributeInteger("Severity", 0)
Parameters.SetAttributeString("Message", "Entity Father found")
}
if(bParentFound == false)
{
listChild2 = ProductOccurrence1.Children
set nbChild2 = listChild2->Size()
index2 = 1
for index2 while index2 <= nbChild2
{
set Child = listChild2->GetItem(index2)
if( (Child <> NULL) and (bParentFound == false) )
{
sName = ""
set ProductOccurrence1 = Child
if(ProductOccurrence1 <> NULL)
set Instance = ProductOccurrence1.Instance
if(NULL <> Instance)
{
sName = Instance.PLM_ExternalID
}
if( (0 <= sName.Search(sSearchIDTitle, 0, true)) or (0 <= sName.Search(sSearchIDName, 0, true)) )
{
bParentFound = true
Parameters.SetAttributeObject("PhysicalParent", ProductOccurrence1)
Parameters.SetAttributeInteger("Severity", 0)
Parameters.SetAttributeString("Message", "Entity Father found")
}
}
}
}
}
}
}
}
if(bParentFound == false)
{
sMessage = sMessage + "Enitity Father not found"
Parameters.SetAttributeInteger("Severity", 2)
Parameters.SetAttributeString("Message", sMessage)
}