General InformationThis opening ID is invoked during the creation of a Piping or a HVAC BOM table template. It creates an arbitrary classification of parts in Branches, Fittings, Flanges, Valves, Instruments, Legacy (old V5 data model), Welds. Customizing this rule lets you to implement different grouping rule for parts, or to do grouping of pipes (rigid or flexible). Sample
Result = NULL let PipingPartObject(Piping_Part) let PipingPipeObject(Piping_Pipe) let PipingSpoolObject(Piping_Spool) set PipingPartObject = ThisObject.Reference set PipingPipeObject = ThisObject.Reference set PipingSpoolObject = ThisObject.Reference if (PipingPartObject <> NULL) { // Categories depends on the object type let TypeName(String) TypeName = PipingPartObject.PrimaryType.Name // Branches if (TypeName == "Piping_Tee" OR TypeName == "Piping_Cross" OR TypeName == "Piping_Olet") { Result = "Category_Branches" } // Fittings else if (TypeName == "Piping_Elbow" OR TypeName == "Piping_Cap" OR TypeName == "Piping_Reducer" OR TypeName == "Piping_Union" OR TypeName == "Piping_Coupling" OR TypeName == "Piping_Gasket") { Result = "Category_Fittings" } // Flanges else if (TypeName == "Piping_Flange") { Result = "Category_Flanges" } // Valves else if (TypeName == "Piping_Valve") { Result = "Category_Valves" } // Instruments else if (TypeName == "Piping_Instrument") { Result = "Category_Instruments" } // Legacy else if (TypeName == "Piping_PartV1") { Result = "Category_Legacy" } // If type is not known, put it into Fittings else { Result = "Category_Fittings" } // Be sure to have setup the correct NLS for categories } else if (PipingPipeObject <> NULL) { // In case it is a Piping pipe, the category is simply "Piping_Pipe" Result = "Category_Pipes" // Here it is possible to make distinctions. For example to make distinction between Rigid Pipes and Flexible Pipes } else if (PipingSpoolObject <> NULL) { // In case it is a Piping spool, the category is simply "Piping_Spool" Result = "Category_Spools" } //Message("Result: ", Result) |