General InformationThis opening ID is invoked during the creation of a Piping or a HVAC BOM table template. It computes the description property depending on the BOMPipeDescription attribute from the drawing profile. Customizing this rule lets you to implement another way to compute the description property. Sample
Result = NULL
let PipeDescriptionMode(Integer)
if (Parameters.HasAttribute("BOMPipeDescription"))
{
PipeDescriptionMode = Parameters.GetAttributeInteger("BOMPipeDescription")
}
else {
PipeDescriptionMode = 3
}
let PipingPipeObject(Piping_Pipe)
set PipingPipeObject = ThisObject.Reference
if (PipingPipeObject <> NULL)
{
if (PipeDescriptionMode == 1)
{
Result = PipingPipeObject.V_description
let MysteriousNewlineChar(String)
MysteriousNewlineChar = TextFormat("|","")
Result = ReplaceAll(Result, MysteriousNewlineChar, " - ")
}
if (PipeDescriptionMode == 2 OR (PipeDescriptionMode == 1 AND (Result == "") ) )
{
// Compute SubPartType
// For now, assume it is always "PIPE" (no distinction between Flexible and Rigid)
let PipeType(String)
PipeType = "PIPE"
// Compute NominalSize
let NominalSize(String)
if (PipingPipeObject.V_NominalSize <> "")
NominalSize= " - " + PipingPipeObject.V_NominalSize
else
NominalSize = " - [V_NominalSize]"
// Compute OutsideDiameter, we add it in case part is not a ANSI part
let OutsideDiameter(String)
OutsideDiameter=""
if(PipingPipeObject.V_Standard <> "ANSI" ){
OutsideDiameter=" - " + (1000*PipingPipeObject.V_OutsideDiameter)
// in case of mm (DIN-EN) need 1 digit, in case of inch need 2 digits. Assume mm for now...
}
// Compute WallThickness
let WallThickness(String)
WallThickness=""
if(PipingPipeObject.V_Standard <> "ANSI" ){
WallThickness="x" + (1000*PipingPipeObject.V_WallThickness)
// in case of mm (DIN-EN) need 1 digit, in case of inch (ANSI) need 2 digits. Assume mm for now...
}
// Compute EndStyle
let EndStyle(String)
if (PipingPipeObject.V_EndStyle <> "")
EndStyle=" - " + PipingPipeObject.V_EndStyle
else
EndStyle = "- [V_EndStyle]"
// Compute Rating
let Rating(String)
if (PipingPipeObject.V_Rating <> "")
Rating=" - " + PipingPipeObject.V_Rating
else
Rating = " - [V_Rating]"
// Compute Material Name
let MaterialName(String)
if (PipingPipeObject.V_MaterialName <> "")
MaterialName = " - " + PipingPipeObject.V_MaterialName
else
MaterialName = "- [V_MaterialName]"
Result = PipeType + NominalSize + OutsideDiameter + WallThickness + EndStyle + Rating + MaterialName
}
else if (PipeDescriptionMode == 3)
{
Result = PipingPipeObject.V_Name
}
}
//Message("Result: ", Result)
| |||||||