EKL - Automation Implement link creation

Context :

Link 2D Schematic and 3D Design object by creating automatically Implement links

 

UseCase1 : Create Occ/Occ Implement Links bewteen LineID and 3D piping Elements

Description:

We start with :

  • Logical and Physical structure that are already linked toghether with Ref / Ref Implement links
  • the logical Structure contains LineID object
  • The Physical Structure contains 3DPiping Pipe and Parts
  • We have an XLS file that contains the liste of Piping Part/Pipes Reference/Instance Names and the target LineID name
  •  

We run the Action tha twill create the Occ/Occ Implement link beteen the 3DEXP object according the XLS file description 

Video

 

Code:

 

 

 

 

Use Case 2 : create Ref / Ref Implement Links

Description:

Here's an action allowing to create Ref-Ref implement links between objects having the same instance name.

To use it, you need to manually create an implement link between the physical and logical root (only the highest in the tree).

Then, when pasting the following code in an action, create the following arguments:

LogicalRoot (LogicalOccurrence)
PhysicalRoot (ProductOccurrence)

Then, when running the action, select the previously linked physical and logical root as inputs.

 

EKL Action Code:

let netOcc (LogicalOccurrence)
let GroupOccurrence1 (ProductOccurrence)
let lstNetGroupOcc, lstGrpOcc, targetList, sourceList (List)
let i, j (Integer)
let implLink (RFLPLMImplementConnection)
sourceList.Append(PhysicalRoot)
targetList.Append(LogicalRoot)
//implLink = new("RFLPLMImplementConnection", " - ", NULL, sourceList, targetList)
sourceList.RemoveItem(1)    
targetList.RemoveItem(1)
lstGrpOcc = PhysicalRoot.Query("ProductOccurrence","")
//Notify("prod1",lstGrpOcc.Size())
lstNetGroupOcc=LogicalRoot.Query("LogicalOccurrence","")
//Notify("log1",lstNetGroupOcc.Size())
for i = 1 while i<= lstGrpOcc.Size()
{    
    //Notify("OK",true)
    set GroupOccurrence1 = lstGrpOcc[i]
    for j=1 while j<= lstNetGroupOcc.Size()
    {
        //Notify("OK2",true)
        set netOcc = lstNetGroupOcc[j]
        //Notify("",netOcc.Name)
        if not(netOcc.Reference.IsSupporting("EnsLogicalEquipment")){
            //Notify("OK3",true)
        
            //Notify("CheckNames",netOcc.Name==GroupOccurrence1.Name)
            //Notify("netOcc.Name = ",netOcc.Name)
            //Notify("GroupOccurrence1.Name = ",GroupOccurrence1.Name)
        
            if netOcc.Name==GroupOccurrence1.Name{
                //Notify("OK4",true)
                //set result=false
                //creer lien d'implémente
                sourceList.Append(GroupOccurrence1)
                targetList.Append(netOcc)
                implLink = new("RFLPLMImplementConnection", netOcc.Name+" - "+GroupOccurrence1.Name, NULL, sourceList, targetList)
                //implLink.SetName(oGrpName + i + j +" N2W Implement Relation")
                //Trace(1,"Reference: ", netOcc.Name + "-" + GroupOccurrence1.Name )
                sourceList.RemoveItem(1)    
                targetList.RemoveItem(1)    
        }
    }
    
}
}

 

Data 3DXML - TestFile: