EKL - Piping3D copy attributes inside the part

Context

When moving component inside the product structure, the instance name is recomputed based on the OOTB naming runes, (This can be painfull especially if you have used the instance Name to store the Tag value)

This naming behavior can be parametrized using Initialisation BL of datasetup, BUT  if you don't want to implement such BL, here is exemple of  actions : to post process the data

Scenario

  • for unique component like Spool
    • Move data
    • EKL Action1 to copy the value of the Reference Name to the Instance Name
  • for standard parts like Piping parts
    • EKL Action2 to copy the value of the Instance Name to the Instance Description
    • Move data
    • EKL Action3 to copy the value of the Instance Descriptionto to the Instance Name

 

EKL action Script

EKL Action2 to copy the value of the Instance Name to the Instance Description

/*
Input: ThisObject (VPMInstance)
*/
Let PRDInst(VPMInstance)
Let PRDRef(VPMReference)
set PRDInst=ThisObject
set PRDRef=PRDInst.Reference
Let PRDChildrenList(List)
let PRDChildrenListSize(integer)
let PRDChildren(VPMInstance)
let PRDChildrenRef(VPMReference)
let InstName (String)
let InstDesc (String)
let AttValue(string)
//retreive all Children Piping Part from selected Product
set PRDChildrenList =PRDRef.Query("Piping_Part_Inst","")
set PRDChildrenListSize=PRDChildrenList->Size()
let i(integer)
i=1
// For Each Part
For i While  i<=PRDChildrenListSize
{
    // retreive each Part instance name
    set PRDChildren=PRDChildrenList->GetItem(i)
    // retreive instance name
    set InstName=PRDChildren.PLM_ExternalID
    //copy it to instance Description
    AttValue=InstName
    PRDChildren.V_description=AttValue
    i=i+1
}    

 

EKL Action3 to copy the value of the Instance Descriptionto to the Instance Name

/*
Input: ThisObject (VPMInstance)
*/
Let PRDInst(VPMInstance)
Let PRDRef(VPMReference)
set PRDInst=ThisObject
set PRDRef=PRDInst.Reference
Let PRDChildrenList(List)
let PRDChildrenListSize(integer)
let PRDChildren(VPMInstance)
let PRDChildrenRef(VPMReference)
let InstName (String)
let InstDesc (String)
let AttValue(string)
//retreive all Children Piping Part from selected Product
set PRDChildrenList =PRDRef.Query("Piping_Part_Inst","")
set PRDChildrenListSize=PRDChildrenList->Size()
let i(integer)
i=1
// For Each Part
For i While  i<=PRDChildrenListSize
{
    // retreive each Part instance name
    set PRDChildren=PRDChildrenList->GetItem(i)
    // retreive instance Description
    set InstDesc=PRDChildren.V_description
    //copy it to instance Name
    AttValue=InstDesc
    PRDChildren.PLM_ExternalID=AttValue
    i=i+1
}    

 

EKL Action1 to copy the value of the Reference Name to the Instance Name

/*
Input: ThisObject (VPMInstance)
*/
Let PRDInst(VPMInstance)
Let PRDRef(VPMReference)
set PRDInst=ThisObject
set PRDRef=PRDInst.Reference
Let PRDChildrenList(List)
let PRDChildrenListSize(integer)
let PRDChildren(VPMInstance)
let PRDChildrenRef(VPMReference)
let InstName (String)
let InstDesc (String)
let RefName (string)
let AttValue(string)
//retreive all Children Piping Part from selected Product
set PRDChildrenList =PRDRef.Query("Piping_Spool","")
set PRDChildrenListSize=PRDChildrenList->Size()
let i(integer)
i=1
// For Each Part
For i While  i<=PRDChildrenListSize
{
    // retreive each Part instance name
    set PRDChildren=PRDChildrenList->GetItem(i)
    set PRDChildrenRef=PRDChildren.Reference
    // retreive instance name
    set RefName=PRDChildrenRef.V_Name
    //copy it to instance Description
    AttValue=RefName
    PRDChildren.PLM_ExternalID=AttValue
    i=i+1
}    

 

BUSINESS RULES

here is an exemple of Code to implement into the BL initialisation resourceSet to be able to maintain the instance name when moving the instance inside the product structure

--> TO COME