General InformationThis opening ID is invoked when you click the Space Coloring command. This opening ID is used to customize the colors of the space references according to their extensions and attributes.
Input ObjectsInput objects must be of the following types:
SamplesThe following samples explain the business rules for coloring of space references. Sample 1: This business rule assigns colors to space references depending on their customer extensions. /* ThisObject Type = VPMReference Parameters Type = RuleContext */ let RValue(Integer) let GValue(Integer) let BValue(Integer) let CustomerExtensionName(String) set CustomerExtensionName= Parameters.GetAttributeString("CustomerExtensionName") /* Set RGB color */ if("NAVCabin" == CustomerExtensionName) { RValue = 0 GValue = 0 BValue = 255 } else if("NAVPool" == CustomerExtensionName) { RValue = 255 GValue = 0 BValue = 0 } else if("NAVRestaurant" == CustomerExtensionName) { RValue = 128 GValue = 0 BValue = 255 } else if("NAVLobby" == CustomerExtensionName) { RValue = 255 GValue = 255 BValue = 0 } else if("NAVGymnasium" == CustomerExtensionName) { RValue = 255 GValue = 128 BValue = 0 } else if("NAVInternalVol" == CustomerExtensionName) { RValue = 0 GValue = 0 BValue = 0 } else if("Default" == CustomerExtensionName) { RValue = 128 GValue = 128 BValue = 128 } Parameters.SetAttributeInteger("RValue", RValue) Parameters.SetAttributeInteger("GValue", GValue) Parameters.SetAttributeInteger("BValue", BValue) Sample 2: This business rule assigns colors to space references depending on their attributes. /* ThisObject Type = VPMReference Parameters Type = RuleContext */ /* ## Explanation of the sample script ## Test Data Model has two space references. 1. Title: Design Space Reference 01 / Floor Area: 0.009m2 2. Title: Design Space Reference 02 / Floor Area: 0.008m2 3. Title: Manufacturing Space Reference 03 / No Floor Area This example code changes color of space reference depending on conditions. 1. If space reference name includes "Design Space Reference" and floor area is 0.009m2, then its color would be Red. 2. If space reference name includes "Design Space Reference" and floor area is 0.008m2, then its color would be Blue. */ let RValue(Integer) let GValue(Integer) let BValue(Integer) let attrTitle(String) let attrFloorArea(Area) let attrFloorAreaStr(String) if(ThisObject <> NULL) { attrTitle=ThisObject.GetAttributeString("V_Name") if attrTitle like "Design Space Reference*" { attrFloorArea=ThisObject.GetAttributeReal("V_FloorArea")*1m2 attrFloorAreaStr = DimToString(attrFloorArea, "m2") if("0.009m2" == attrFloorAreaStr) { RValue = 255 GValue = 0 BValue = 0 } else if("0.008m2" == attrFloorAreaStr) { RValue = 0 GValue = 0 BValue = 255 } } } Parameters.SetAttributeInteger("RValue", RValue) Parameters.SetAttributeInteger("GValue", GValue) Parameters.SetAttributeInteger("BValue", BValue) |