Fluidic (Piping/HVAC) BOM Table Template Business Rule (Piping_Spool_Weight)

An opening ID is an entry point used to customize business logic. The Piping_Spool_Weight business rule opening ID is used by assembly isometric to compute the weight property of a Piping_Spool.

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 during the creation of a Piping or a HVAC BOM table template.

It computes the weight using the Declared Weight of the spool, or using the weight of all the parts and pipes in the spool.

Customizing this rule lets you to implement another way to compute the weight of spools.

Sample

Result = NULL

//Trace(2,"Spool weight EKL code...")
  
let PipingSpoolObject(Piping_Spool)
let PipingPipeObject(Piping_Pipe)
let ChildOcc(ProductOccurrence)
let ChildRef(VPMReference)
let ChildrenList(List)
let i(Integer)
let TotalWeight(Real)
let ComputedWeight(WCGEquivalentComputedExt)
let DeclaredWeight(WCGEquivalentDeclaredWeightExt)

set PipingSpoolObject = ThisObject.Reference

if (PipingSpoolObject <> NULL)
{
  //Trace(2,"Spool name = ",PipingSpoolObject.V_Name)
}
else {
  //Trace(2,"Spool name = ","NOT A SPOOL")
}  


TotalWeight = 0.0


  
set ComputedWeight = ThisObject.Reference

if (ComputedWeight <> NULL)
{
  TotalWeight = ComputedWeight.V_WCG_Mass 
}
else 
{

  set DeclaredWeight = ThisObject.Reference
  
  if (DeclaredWeight <> NULL) 
  {
    TotalWeight = DeclaredWeight.V_WCG_Declared_Mass 
  }
}

if( TotalWeight == 0.0 )
{
  ChildrenList = ThisObject.Children 
  //Trace(2,"Spool has children: ",ChildrenList.Size() )
  i=1
  for i while i < ChildrenList.Size()
  {
	set ChildOcc = ChildrenList->GetItem(i)
	if(ChildOcc <> NULL){
      set ChildRef=ChildOcc.Reference
	  //Trace(2,"Processing part ",i," in spool : ", ChildRef.Name )
      set ComputedWeight = ChildOcc.Reference
      if (ComputedWeight <> NULL)
      {
        TotalWeight = TotalWeight + ComputedWeight.V_WCG_Mass 
		//Trace(2,"Part has computed weight")
      }
      else 
      {
	    //Trace(2,"Part has no computed weight")
        set DeclaredWeight = ChildOcc.Reference
        if (DeclaredWeight <> NULL) 
        {
          TotalWeight = TotalWeight + DeclaredWeight.V_WCG_Declared_Mass 
		  //Trace(2,"Part has declared weight")
        }
        else {
          //Trace(2,"Part in spool does not have weight: ", ChildRef.Name )
          set PipingPipeObject = ChildOcc.Reference

          if (PipingPipeObject <> NULL)
          {
		    //Trace(2,"Pipe, compute the weight from linear weight")
		    if(PipingPipeObject.V_Linearweight==0.0)
			{
			  //Trace(2,"Pipe does not have a linear weight: ", ChildRef.Name)
			}
			else {  
              TotalWeight = TotalWeight + PipingPipeObject.V_Length * PipingPipeObject.V_Linearweight
			}
          }
	    }
      }
	}
  }
}

Result = TotalWeight
//Message("Result spool weight: ", Result)
//Trace(2, "Result spool weight: ", Result)