Piping 3D Report - System/LineID/Spool/Part/Attributes

Context :

Extract report for all Piping 3D object in session with following informations

  • System Name : Parent Product Name (L+2)
  • Parent LineID / Name
  • Parent LineID / Piping Specification 
  • Spool Name : Parent Spool Name
  • Pipe/Part PartNumber
  • Pipe Dimensions (OD, WT , ....)
  • Pipe/Part Material
  • Pipe/Part NominalSize
  • Pipe length
  • Weight Approximate from LineId attributes (needs to declare a linear weight)
  • Pipe Node information

 

Sample Data:

R2024x 3DXML

 

Code used in the sample data report templates

Piping 3D : Parent ProductName (System)

//ProductOccurence ; string
/* get service based on defined structure */
let ref (VPMReference)
let occ (ProductOccurrence )
let occService(ProductOccurrence )
let SpoolName(String)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let InsulationOcc(Piping_Insulation_Occurrence)
let PIPref(VPMReference)

Attribute="?"

set PIPref=ThisObject.Reference
set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
set InsulationOcc=ThisObject

set occ=ThisObject.Owner
ref=occ.Reference

if (PIPref->IsASortOf("Piping_Part" ))
{
SpoolName=PipingPartOcc->GetSpoolName()
}
else if (PIPref->IsASortOf("Piping_Pipe"))
{
SpoolName=PipeOcc->GetSpoolName()
}
else if (PIPref->IsASortOf("Piping_Insulation"))
{
SpoolName=InsulationOcc->GetSpoolName()
}
                
if (SpoolName == NULL)
{
Attribute=ref.V_Name          
}
else
{
set occService=occ.Owner
set ref=occService.Reference
Attribute=ref.V_Name          
}                               

 

Piping 3D : Parent line ID name

//ProductOccurence ; string
/* get LineID for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let InsulationOcc(Piping_Insulation_Occurrence)
let LineIDInst(Piping_Line_Inst)
let LineID(Piping_Line)
let LineIDName(String)

set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
set InsulationOcc=ThisObject

ref = ThisObject.Reference

if (ref->IsASortOf("Piping_Part" ))
{
                LineIDName=PipingPartOcc.GetLineIDName()
                Attribute=LineIDName
}
else if (ref->IsASortOf("Piping_Pipe"))
{
                LineIDName=PipeOcc.GetLineIDName()
                Attribute=LineIDName
}

else if (ref->IsASortOf("Piping_Insulation"))
{
                LineIDName=InsulationOcc.GetLineIDName()
                Attribute=LineIDName
}
else
{
                Attribute="No Piping"
}

 

Piping 3D : Parent line ID Spec name

//ProductOccurence ; string
/* get LineID for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let InsulationOcc(Piping_Insulation_Occurrence)
let LineIDInst(Piping_Line_Inst)
let LineID(Piping_Line)
let LineIDSpec(String)

set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
set InsulationOcc=ThisObject

ref = ThisObject.Reference

if (ref->IsASortOf("Piping_Part" ))
{
LineIDInst=PipingPartOcc.GetLineIDObject()
set LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
}
else if (ref->IsASortOf("Piping_Pipe"))
{
LineIDInst=PipeOcc.GetLineIDObject()
set LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
}
else if (ref->IsASortOf("Piping_Insulation"))
{
LineIDInst=InsulationOcc.GetLineIDObject()
set LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
}
else
{
Attribute="No Piping" 
}

 

Piping 3D : Parent Spool  name

//ProductOccurence ; string
/* get Spool for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let InsulationOcc(Piping_Insulation_Occurrence)

set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
set InsulationOcc=ThisObject
ref = ThisObject.Reference

if (ref->IsASortOf("Piping_Part" ))
{
Attribute=PipingPartOcc->GetSpoolName()
}
else if (ref->IsASortOf("Piping_Pipe"))
{
Attribute=PipeOcc->GetSpoolName()
}
else if (ref->IsASortOf("Piping_Insulation"))
{
Attribute=InsulationOcc->GetSpoolName()
}
else
{
Attribute="No Piping" 
}

 

Piping 3D : Pipe/Part PartNumber

//ProductOccurence ; String

/* get PartNumber for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
Attribute=""
ref=ThisObject.Reference
Attribute=ref.V_Name

 

Piping 3D : Pipe Dimensions

//ProductOccurence ; String
/* get Dimensions for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let pip(Piping_Pipe)
let pipEntity(Piping_Entity)
let PipInsulation(Piping_Insulation)
Attribute=""
ref=ThisObject.Reference

if (ref->IsASortOf("Piping_Pipe" ))
{
                set pip=ref
                set pipEntity=ref
                Attribute=ToString(pip.V_OutsideDiameter ) + "-" + ToString(pip.V_WallThickness) + "-" + pipEntity.V_Rating
}
else if (ref->IsASortOf("Piping_Entity"))
{
                set pipEntity=ref
                Attribute=pipEntity.V_NominalSize + "-" + pipEntity.V_Rating + "-" + pipEntity.V_EndStyle
}
else if (ref->IsASortOf("Piping_Insulation"))
{
                set PipInsulation=ref
                Attribute=PipInsulation.V_NominalSize + "-" + PipInsulation.V_InsulationThickness + "-" + PipInsulation.V_InsulationType + "-" + PipInsulation.V_MinTemperature + "-" + PipInsulation.V_MaxTemperature
}
else
{
Attribute="No Piping" 
}

 

Piping 3D : Pipe/Part Material

//ProductOccurence ; String

/* get Material for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let pipEntity(Piping_Entity)
let PipInsulation(Piping_Insulation)
Attribute=""
ref=ThisObject.Reference

if (ref->IsASortOf("Piping_Entity"))
{
                set pipEntity=ref
                Attribute=pipEntity.V_MaterialName
}
else if (ref->IsASortOf("Piping_Insulation"))
{
                set PipInsulation=ref
                Attribute=PipInsulation.V_MaterialName
}
else
{
Attribute="No Piping" 
}

 

Piping 3D : Pipe/Part NominalSize

//ProductOccurence ; String
/* get NominalSize for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let pipEntity(Piping_Entity)
let PipInsulation(Piping_Insulation)

Attribute=""
ref=ThisObject.Reference

if (ref->IsASortOf("Piping_Entity"))
{
                set pipEntity=ref
                Attribute=pipEntity.V_NominalSize
}
else if (ref->IsASortOf("Piping_Insulation"))
{
                set PipInsulation=ref
                Attribute=PipInsulation.V_NominalSize
}
else
{
Attribute="No Piping" 
}

 

Piping 3D : Pipe Length

//ProductOccurence ; length
/* get Pipe Length for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let pip(Piping_Pipe)
let PipInsulation(Piping_Insulation)

ref=ThisObject.Reference

if (ref->IsASortOf("Piping_Pipe"))
{
                set pip=ref
                Attribute=pip.V_Length
}
else if (ref->IsASortOf("Piping_Insulation"))
{
                set PipInsulation=ref
                Attribute=PipInsulation.V_Length
}
else
{
Attribute=0mm
}

Piping 3D : Weight
//ProductOccurence ; mass
/* get name for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let pip(Piping_Pipe)
let PipInsulation(Piping_Insulation)
let wcg (WCGEquivalentComputedExt)
let wcgDefined (WCGEquivalentDeclaredWeightExt)

set ref=ThisObject.Reference

if (ref->IsASortOf("Piping_Pipe"))
{
                set pip=ref
                Attribute=pip.V_Length*pip.V_Linearweight
}
else if (ref->IsASortOf("Piping_Insulation"))
{
                set PipInsulation=ref
                Attribute=PipInsulation.V_Length*PipInsulation.V_Linearweight
}
else
{
                set wcg=ref
                Attribute=wcg.V_WCG_Mass
                if (wcg==NULL)
                {
                                set wcgDefined=ref
                                Attribute=wcgDefined.V_WCG_Declared_Mass
                }
}

 

Piping 3D : Weight Approximate from LineId attributes (linear weight)

//ProductOccurence ; mass
/* get LineID for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let LineIDInst(Piping_Line_Inst)
let LineID(Piping_Line)
let LineIDDesc(String)
let pip(Piping_Pipe)
let PipeLength(LENGTH)
let PipeLineMass(Mass)
let wcg (WCGEquivalentComputedExt)
let wcgDefined (WCGEquivalentDeclaredWeightExt)

set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
ref = ThisObject.Reference

if (ref->IsASortOf("Piping_Part" ))
{
                set wcg=ref
                Attribute=wcg.V_WCG_Mass
                if (wcg==NULL)
                {
                                set wcgDefined=ref
                                Attribute=wcgDefined.V_WCG_Declared_Mass
                }
}
else if (ref->IsASortOf("Piping_Pipe"))
{
                //Retreive PipeLength
                set pip=ref
                PipeLength=pip.V_Length  
                //retreive Linear Price on Parent lineID
                LineIDInst=PipeOcc.GetLineIDObject()
                set LineID=LineIDInst.Reference
                LineIDDesc=LineID.V_description
                PipeLineMass=LineIDDesc.ToReal()*1kg
                //compute price
                If (LineIDDesc<>"")
                {
                                Attribute=PipeLineMass*PipeLength*1000mm
                }
                else
                                Attribute=0           
}
else
{
                Attribute=0
}

 

Piping 3D : Price Approximate from LineId attributes (linear weight + Price/m)

//ProductOccurence ; Real
/* get LineID for occurrence */
let inst(VPMInstance)
let ref(VPMReference)
let PipingPartOcc (Piping_Part_Occurrence)
let PipeOcc(Piping_Pipe_Occurrence)
let LineIDInst(Piping_Line_Inst)
let LineID(Piping_Line)
let LineIDDesc(String)
let pip(Piping_Pipe)
let PipeLength(LENGTH)
let PipeLineMass(Mass)
let wcg (WCGEquivalentComputedExt)
let wcgDefined (WCGEquivalentDeclaredWeightExt)
Let PipeLinePricePerM (Real)
let LineIDName (String)

set PipeOcc = ThisObject
set PipingPartOcc = ThisObject
ref = ThisObject.Reference

if (ref->IsASortOf("Piping_Part" ))
{
                Attribute=0
}
else if (ref->IsASortOf("Piping_Pipe"))
{
                
                //Define Line Price per Meter
                //Retreive PipeLength
                set pip=ref
                PipeLength=pip.V_Length  
                //retreive Linear Price on Parent lineID
                LineIDInst=PipeOcc.GetLineIDObject()
                set LineID=LineIDInst.Reference
                LineIDDesc=LineID.V_description
                LineIDName=LineID.V_Name
                PipeLineMass=LineIDDesc.ToReal()*1kg
                //compute price
                If (LineIDDesc<>"")
                {
                                If(LineIDName=="ATA38_0_WASTE WATER VACUUM_NSA0141_32")
                                {
                                                PipeLinePricePerM=100
                                                Attribute=PipeLineMass*PipeLength*1000mm*PipeLinePricePerM
                                }
                                else if (LineIDName=="ATA38_0_DRAIN_NSA0141_46")
                                {
                                                PipeLinePricePerM=50
                                                Attribute=PipeLineMass*PipeLength*1000mm*PipeLinePricePerM
                                }
                                else
                                {
                                                Attribute=0
                                }               
                }
                else
                                Attribute=0
                
}
else
{
                Attribute=0
}

Pipe nodes informations

let refPipe(Piping_Rigid_Pipe)
let lNodes(List)
let lNodeRadii(List)
let lNodeAngles(List)
let i(Integer)
let pt(Point)
let lValue(Length)

Attribute=""
set refPipe=ThisObject.Reference
lNodes=refPipe.V_NodePositions
lNodeRadii=refPipe.V_NodeBendRadii
lNodeAngles=refPipe.V_NodeBendAngles

i=1
for i while i<=lNodes->Size()
{
      if (i==1 or abs(lNodeAngles[i])>=0.1deg or i==lNodes->Size())
      /*A node is only reported if it is either the first or last point of the pipe or if the corresponding bend angle is larger or equal 0.1deg (a warning about dimension mismatch is shown for this comparison but can be ignored). */
      {
      set pt=lNodes[i]
      lValue=round(pt->coord(1),"mm",1)*1m
      Attribute=Attribute+DimToString(lValue,"mm")+","
      lValue=round(pt->coord(2),"mm",1)*1m
      Attribute=Attribute+DimToString(lValue,"mm")+","
      lValue=round(pt->coord(3),"mm",1)*1m
      Attribute=Attribute+DimToString(lValue,"mm")
      if (i==1 or i==lNodes->Size())
            {
            Attribute=Attribute+";"
            }
      else
            {
            Attribute=Attribute+","+DimToString(lNodeRadii[i],"mm")+","
            Attribute=Attribute+DimToString(lNodeAngles[i],"deg")+";"
            }
      }
       /*The coordinate values are rounded to 1 digit for the unit of mm. The result is a real value in the SI unit (unlike described in the pop-up help). This is then converted into a Length type variable by multiplying with 1m.
      All length values (coordinate, radius) are now converted into a string based on mm using the DimToString function.
      Bending radius is only shown if it is not the first or last point of the pipe*/
}