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

An opening ID is an entry point used to customize business logic. The Piping_Part_Description business rule opening ID is used to compute the description property of a Piping_Part.

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 description property depending on the BOMPartDescription attribute from the drawing profile. A different drawing profile can generate a different description, for example, a different language, or more or less details.

Customizing this rule lets you to implement another way to compute the description property.

Sample

The following sample

Result = NULL

let PartDescriptionMode(Integer) 
if (Parameters.HasAttribute("BOMPartDescription")) 
{
  PartDescriptionMode = Parameters.GetAttributeInteger("BOMPartDescription")
}
else 
{
  PartDescriptionMode = 3
}

let PipingPartObject(Piping_Part)
set PipingPartObject = ThisObject.Reference

if (PipingPartObject <> NULL)
{
  if (PartDescriptionMode == 1) 
  {
    Result = PipingPartObject.V_description
    
    let MysteriousNewlineChar(String)
    MysteriousNewlineChar = TextFormat("|","")
    Result = ReplaceAll(Result, MysteriousNewlineChar, " - ")
  }
  if (PartDescriptionMode == 2 OR (PartDescriptionMode == 1 AND (Result == "") ) )
  {
    // Compute SubPartType, depending wether it is a Piping_PartV1 or Piping_PartV2
    let SubPartType(String)
    let PipingPartObjectV1(Piping_PartV1)
    let PipingPartObjectV2(Piping_PartV2)
    set PipingPartObjectV1 = ThisObject.Reference
    set PipingPartObjectV2 = ThisObject.Reference
  
    if (PipingPartObjectV1<>NULL) {
      SubPartType = ToUpper(PipingPartObjectV1.V_SubPartType)
    }
    else if  (PipingPartObjectV2<>NULL) {
      SubPartType = ToUpper(PipingPartObjectV2.V_SubPartType)
    }
    else {
      SubPartType = "[V_SubPartType]"
    }
  
    // Compute NominalSize
    let NominalSize(String)
    if (PipingPartObject.V_NominalSize <> "") 
      NominalSize= " - " + PipingPartObject.V_NominalSize
    else
      NominalSize = " - [V_NominalSize]"
  
    // Compute EndStyle
    let EndStyle(String)
    if (PipingPartObject.V_EndStyle <> "") 
      EndStyle=" - " + PipingPartObject.V_EndStyle
    else
      EndStyle = "- [V_EndStyle]"
  
    // Compute Rating        
    let Rating(String)
    if (PipingPartObject.V_Rating <> "")
      Rating=" - " + PipingPartObject.V_Rating
    else
      Rating = " - [V_Rating]"
  
    // Compute Material Name
    let MaterialName(String)
    if (PipingPartObject.V_MaterialName <> "")
      MaterialName = " - " + PipingPartObject.V_MaterialName
    else
      MaterialName = "- [V_MaterialName]"    
  
    Result = SubPartType + NominalSize + EndStyle + Rating + MaterialName
  }
  else if (PartDescriptionMode == 3) 
  {
    Result = PipingPartObject.V_Name
  }
}

//Message("Result: ", Result)