Compute Parent of 3D Physical (L2P_Compute3DParent)

An opening ID is an entry point used to customize business logic. The Compute Parent of 3D Physical opening ID is available in the Logical to Physical Assistant Resources resource set.

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 to compute physical aggregating product where 3D physical object should be instantiated.

Definition Description
PLM Opening ID L2P_Compute3DParent
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: an L2PItem object, containing the data found during the analysis of this logical object.
  • Parameters corresponds to the context object.

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)
}