Context
In some cases you want to propagate an information from one object to another during the creation of the Implement link
- it can be propagate the Tag attribute of Schematic object to the 3D instance object
- it can be propagate a property of the 3D object to the 2D object
Datasetup Resource Set : Business Logic for ITEM
Datasetup Resource : After creation of PPR link
Exemples
Use case 1 :
Propagate attribute value of logical Object instance Name to linked 3D object instance Name
Code: BR Sample for Piping Valve only
//ThisObject -> Feature : PArameters -> RuleContext
let lSources(List)
let lTargets(List)
let ustrRelationName(String)
set lSources = Parameters->GetAttributeObject("Source")
set lTargets = Parameters->GetAttributeObject("Target")
ustrRelationName = Parameters->GetAttributeString("RelationType")
if ((ustrRelationName == "PLM_ImplementLink_Target") and (lSources.Size() > 0) and (lTargets.Size() > 0))
{
let sourcePhysicalInstance(VPMInstance)
let targetLogicalInstance(RFLVPMLogicalInstance)
set targetLogicalInstance = lTargets[lTargets.Size()]
set sourcePhysicalInstance = lSources[lSources.Size()]
if (sourcePhysicalInstance <> NULL and targetLogicalInstance <> NULL)
{
let ustrLogicalInstanceName(String)
let ustrPhycialInstanceName(String)
ustrLogicalInstanceName= targetLogicalInstance.Name
ustrPhycialInstanceName= sourcePhysicalInstance.Name
if(sourcePhysicalInstance.IsSupporting("Piping_Valve_Inst"))
{
sourcePhysicalInstance.Name = targetLogicalInstance.Name
}
}
}
