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
Filter Expression
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 */
<strong>let</strong> ref (VPMReference)
<strong>let</strong> occ (ProductOccurrence )
<strong>let</strong> occService(ProductOccurrence )
<strong>let</strong> SpoolName(String)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> InsulationOcc(Piping_Insulation_Occurrence)
<strong>let</strong> PIPref(VPMReference)
Attribute="?"
<strong>set</strong> PIPref=ThisObject.Reference
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
<strong>set</strong> InsulationOcc=ThisObject
<strong>set</strong> occ=ThisObject.Owner
ref=occ.Reference
<strong>if</strong> (PIPref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
SpoolName=PipingPartOcc->GetSpoolName()
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (PIPref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
SpoolName=PipeOcc->GetSpoolName()
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (PIPref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
SpoolName=InsulationOcc->GetSpoolName()
<strong>}</strong>
<strong>if</strong> (SpoolName == NULL)
<strong>{<!-- --></strong>
Attribute=ref.V_Name
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
<strong>set</strong> occService=occ.Owner
<strong>set</strong> ref=occService.Reference
Attribute=ref.V_Name
<strong>}</strong>
Piping 3D : Parent line ID name
//ProductOccurence ; string
/* get LineID for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> InsulationOcc(Piping_Insulation_Occurrence)
<strong>let</strong> LineIDInst(Piping_Line_Inst)
<strong>let</strong> LineID(Piping_Line)
<strong>let</strong> LineIDName(String)
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
<strong>set</strong> InsulationOcc=ThisObject
ref = ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
LineIDName=PipingPartOcc.GetLineIDName()
Attribute=LineIDName
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
LineIDName=PipeOcc.GetLineIDName()
Attribute=LineIDName
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
LineIDName=InsulationOcc.GetLineIDName()
Attribute=LineIDName
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Parent line ID Spec name
//ProductOccurence ; string
/* get LineID for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> InsulationOcc(Piping_Insulation_Occurrence)
<strong>let</strong> LineIDInst(Piping_Line_Inst)
<strong>let</strong> LineID(Piping_Line)
<strong>let</strong> LineIDSpec(String)
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
<strong>set</strong> InsulationOcc=ThisObject
ref = ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
LineIDInst=PipingPartOcc.GetLineIDObject()
<strong>set</strong> LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
LineIDInst=PipeOcc.GetLineIDObject()
<strong>set</strong> LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
LineIDInst=InsulationOcc.GetLineIDObject()
<strong>set</strong> LineID=LineIDInst.Reference
LineIDSpec=LineID.V_PipeSpecification
Attribute=LineIDSpec
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Parent Spool name
//ProductOccurence ; string
/* get Spool for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> InsulationOcc(Piping_Insulation_Occurrence)
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
<strong>set</strong> InsulationOcc=ThisObject
ref = ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
Attribute=PipingPartOcc->GetSpoolName()
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
Attribute=PipeOcc->GetSpoolName()
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
Attribute=InsulationOcc->GetSpoolName()
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Pipe/Part PartNumber
//ProductOccurence ; String /* get PartNumber for occurrence */ <strong>let</strong> inst(VPMInstance) <strong>let</strong> ref(VPMReference) Attribute="" ref=ThisObject.Reference Attribute=ref.V_Name
Piping 3D : Pipe Dimensions
//ProductOccurence ; String
/* get Dimensions for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> pip(Piping_Pipe)
<strong>let</strong> pipEntity(Piping_Entity)
<strong>let</strong> PipInsulation(Piping_Insulation)
Attribute=""
ref=ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Pipe" ))
<strong>{<!-- --></strong>
<strong>set</strong> pip=ref
<strong>set</strong> pipEntity=ref
Attribute=ToString(pip.V_OutsideDiameter ) + "-" + ToString(pip.V_WallThickness) + "-" + pipEntity.V_Rating
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Entity"))
<strong>{<!-- --></strong>
<strong>set</strong> pipEntity=ref
Attribute=pipEntity.V_NominalSize + "-" + pipEntity.V_Rating + "-" + pipEntity.V_EndStyle
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
<strong>set</strong> PipInsulation=ref
Attribute=PipInsulation.V_NominalSize + "-" + PipInsulation.V_InsulationThickness + "-" + PipInsulation.V_InsulationType + "-" + PipInsulation.V_MinTemperature + "-" + PipInsulation.V_MaxTemperature
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Pipe/Part Material
//ProductOccurence ; String
/* get Material for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> pipEntity(Piping_Entity)
<strong>let</strong> PipInsulation(Piping_Insulation)
Attribute=""
ref=ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Entity"))
<strong>{<!-- --></strong>
<strong>set</strong> pipEntity=ref
Attribute=pipEntity.V_MaterialName
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
<strong>set</strong> PipInsulation=ref
Attribute=PipInsulation.V_MaterialName
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Pipe/Part NominalSize
//ProductOccurence ; String
/* get NominalSize for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> pipEntity(Piping_Entity)
<strong>let</strong> PipInsulation(Piping_Insulation)
Attribute=""
ref=ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Entity"))
<strong>{<!-- --></strong>
<strong>set</strong> pipEntity=ref
Attribute=pipEntity.V_NominalSize
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
<strong>set</strong> PipInsulation=ref
Attribute=PipInsulation.V_NominalSize
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute="No Piping"
<strong>}</strong>
Piping 3D : Pipe Length
//ProductOccurence ; length
/* get Pipe Length for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> pip(Piping_Pipe)
<strong>let</strong> PipInsulation(Piping_Insulation)
ref=ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
<strong>set</strong> pip=ref
Attribute=pip.V_Length
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
<strong>set</strong> PipInsulation=ref
Attribute=PipInsulation.V_Length
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute=0mm
<strong>}</strong>
Piping 3D : Weight
//ProductOccurence ; mass
/* get name for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> pip(Piping_Pipe)
<strong>let</strong> PipInsulation(Piping_Insulation)
<strong>let</strong> wcg (WCGEquivalentComputedExt)
<strong>let</strong> wcgDefined (WCGEquivalentDeclaredWeightExt)
<strong>set</strong> ref=ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
<strong>set</strong> pip=ref
Attribute=pip.V_Length*pip.V_Linearweight
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Insulation"))
<strong>{<!-- --></strong>
<strong>set</strong> PipInsulation=ref
Attribute=PipInsulation.V_Length*PipInsulation.V_Linearweight
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
<strong>set</strong> wcg=ref
Attribute=wcg.V_WCG_Mass
<strong>if</strong> (wcg==NULL)
<strong>{<!-- --></strong>
<strong>set</strong> wcgDefined=ref
Attribute=wcgDefined.V_WCG_Declared_Mass
<strong>}</strong>
<strong>}</strong>
Piping 3D : Weight Approximate from LineId attributes (linear weight)
//ProductOccurence ; mass
/* get LineID for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> LineIDInst(Piping_Line_Inst)
<strong>let</strong> LineID(Piping_Line)
<strong>let</strong> LineIDDesc(String)
<strong>let</strong> pip(Piping_Pipe)
<strong>let</strong> PipeLength(LENGTH)
<strong>let</strong> PipeLineMass(Mass)
<strong>let</strong> wcg (WCGEquivalentComputedExt)
<strong>let</strong> wcgDefined (WCGEquivalentDeclaredWeightExt)
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
ref = ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
<strong>set</strong> wcg=ref
Attribute=wcg.V_WCG_Mass
<strong>if</strong> (wcg==NULL)
<strong>{<!-- --></strong>
<strong>set</strong> wcgDefined=ref
Attribute=wcgDefined.V_WCG_Declared_Mass
<strong>}</strong>
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
//Retreive PipeLength
<strong>set</strong> pip=ref
PipeLength=pip.V_Length
//retreive Linear Price on Parent lineID
LineIDInst=PipeOcc.GetLineIDObject()
<strong>set</strong> LineID=LineIDInst.Reference
LineIDDesc=LineID.V_description
PipeLineMass=LineIDDesc.ToReal()*1kg
//compute price
<strong>If</strong> (LineIDDesc<>"")
<strong>{<!-- --></strong>
Attribute=PipeLineMass*PipeLength*1000mm
<strong>}</strong>
<strong>else</strong>
Attribute=0
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute=0
<strong>}</strong>
Piping 3D : Price Approximate from LineId attributes (linear weight + Price/m)
//ProductOccurence ; Real
/* get LineID for occurrence */
<strong>let</strong> inst(VPMInstance)
<strong>let</strong> ref(VPMReference)
<strong>let</strong> PipingPartOcc (Piping_Part_Occurrence)
<strong>let</strong> PipeOcc(Piping_Pipe_Occurrence)
<strong>let</strong> LineIDInst(Piping_Line_Inst)
<strong>let</strong> LineID(Piping_Line)
<strong>let</strong> LineIDDesc(String)
<strong>let</strong> pip(Piping_Pipe)
<strong>let</strong> PipeLength(LENGTH)
<strong>let</strong> PipeLineMass(Mass)
<strong>let</strong> wcg (WCGEquivalentComputedExt)
<strong>let</strong> wcgDefined (WCGEquivalentDeclaredWeightExt)
<strong>Let</strong> PipeLinePricePerM (Real)
<strong>let</strong> LineIDName (String)
<strong>set</strong> PipeOcc = ThisObject
<strong>set</strong> PipingPartOcc = ThisObject
ref = ThisObject.Reference
<strong>if</strong> (ref->IsASortOf("Piping_Part" ))
<strong>{<!-- --></strong>
Attribute=0
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (ref->IsASortOf("Piping_Pipe"))
<strong>{<!-- --></strong>
//Define Line Price per Meter
//Retreive PipeLength
<strong>set</strong> pip=ref
PipeLength=pip.V_Length
//retreive Linear Price on Parent lineID
LineIDInst=PipeOcc.GetLineIDObject()
<strong>set</strong> LineID=LineIDInst.Reference
LineIDDesc=LineID.V_description
LineIDName=LineID.V_Name
PipeLineMass=LineIDDesc.ToReal()*1kg
//compute price
<strong>If</strong> (LineIDDesc<>"")
<strong>{<!-- --></strong>
<strong>If</strong>(LineIDName=="ATA38_0_WASTE WATER VACUUM_NSA0141_32")
<strong>{<!-- --></strong>
PipeLinePricePerM=100
Attribute=PipeLineMass*PipeLength*1000mm*PipeLinePricePerM
<strong>}</strong>
<strong>else</strong> <strong>if</strong> (LineIDName=="ATA38_0_DRAIN_NSA0141_46")
<strong>{<!-- --></strong>
PipeLinePricePerM=50
Attribute=PipeLineMass*PipeLength*1000mm*PipeLinePricePerM
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute=0
<strong>}</strong>
<strong>}</strong>
<strong>else</strong>
Attribute=0
<strong>}</strong>
<strong>else</strong>
<strong>{<!-- --></strong>
Attribute=0
<strong>}</strong>
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*/
}
Code for Report Filter expression
Get only Rigid Pipe:
ReturnBool = ThisObject.Reference->IsASortOf("Piping_Rigid_Pipe")
Get Rigid & flexible Pipe:
ReturnBool = ThisObject.Reference->IsASortOf("Piping_Pipe")
Get only piping parts and Pipes
ReturnBool = ThisObject.Reference->IsASortOf("Piping_Entity")
