General InformationThis opening ID is invoked during the creation of a Piping or a HVAC BOM table template. It takes the sum of the length of the pipes in the spool. Customizing this rule lets you to implement another way to compute the length of spools. Sample
Result = NULL Trace(2,"Spool length EKL code...") let PipingSpoolObject(Piping_Spool) let PipingPartObject(Piping_Part) let PipingPipeObject(Piping_Pipe) let ChildOcc(ProductOccurrence) let ChildrenList(List) let i(Integer) let TotalLength(Real) TotalLength = 0.0 set PipingSpoolObject = ThisObject.Reference if (PipingSpoolObject <> NULL) { Trace(2,"Spool name = ",PipingSpoolObject.Name) Result = 0.0 // Result = PipingPipeObject.V_Length ChildrenList = ThisObject.Children i=1 for i while i < ChildrenList.Size() { set ChildOcc = ChildrenList->GetItem(i) if(ChildOcc <> NULL){ set PipingPipeObject = ChildOcc.Reference if( PipingPipeObject <> NULL ){ TotalLength = TotalLength + PipingPipeObject.V_Length } } else { set PipingPartObject = ChildOcc.Reference if( PipingPartObject <> NULL ){ TotalLength = TotalLength +0.0 } } } } else { Trace(2,"Spool name = ","NOT A SPOOL") } Result= TotalLength //Message("Result: ", Result) Trace(2,"Spool Total Length = ",Result) |