Business Rule: Insulation Color (Color ID)

An opening ID is an entry point used to customize business logic. Color ID defines a specific color to an insulation based on the type of a feature.

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 when you:

  • Apply insulation to a feature
  • Change the category of insulation

This opening ID is used to customize the color of an insulation based on the type of a feature on which insulation is applied.

DefinitionDescription
PLM Opening IDColor ID
Customization intent Computation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject: VPMReference
  • Parameters: RuleContext

Sample

The following sample assigns color to an insulation as per the type of the feature.

/*
ThisObject Type = VPMReference
Parameters Type = RuleContext
*/
/* Initialize Input featue*/

let INS_PanelInsulation(InsStrPanelInsulationFeature)
let INS_ProfileInsulation(InsStrProfileInsulationFeature)

let RValue(Integer)
let GValue(Integer)
let BValue(Integer)

set INS_PanelInsulation = Parameters.GetAttributeObject("INSFeatureType")
set INS_ProfileInsulation = Parameters.GetAttributeObject("INSFeatureType")

 if(NULL <> INS_PanelInsulation)
{
	//Check the childrens first and go to top in hierarchy
	if(INS_PanelInsulation.IsASortOf("DeckInsulation"))
	{
		RValue = 0
		GValue = 128
		BValue = 128
	}
	else if(INS_PanelInsulation.IsASortOf("BulkheadInsulation"))
	{
		RValue = 255
		GValue = 255
		BValue = 0
	}
	else if(INS_PanelInsulation.IsASortOf("LBHeadInsulation"))
	{
		RValue = 0
		GValue = 128
		BValue = 0
	}
	else if(INS_PanelInsulation.IsASortOf("TBHeadInsulation"))
	{
		RValue = 129
		GValue = 192
		BValue = 232
	}
	else
	{
		RValue = 211
		GValue = 178
		BValue = 125
	}
}
if(NULL <> INS_ProfileInsulation)
{
               //Check the childrens first and go to top in hierarchy
	if(INS_ProfileInsulation.IsASortOf("DeckStiffenerInsulation"))
	{
		RValue = 0
		GValue = 128
		BValue = 128
	}
	else if(INS_ProfileInsulation.IsASortOf("BulkheadStiffenerInsulation"))
	{
		RValue = 255
		GValue = 255
		BValue = 0
	}
	else if(INS_ProfileInsulation.IsASortOf("LBHeadStiffenerInsulation"))
	{
		RValue = 0
		GValue = 128
		BValue = 0
	}
	else if(INS_ProfileInsulation.IsASortOf("TBHeadStiffenerInsulation"))
	{
		RValue = 129
		GValue = 192
		BValue = 232
	}
	else if(INS_ProfileInsulation.IsASortOf("MemberInsulation"))
	{
		RValue = 0
		GValue = 178
		BValue = 125
	}
	else
	{
		RValue = 211
		GValue = 178
		BValue = 125
	}
}
Parameters.SetAttributeInteger("oRValue", RValue)
Parameters.SetAttributeInteger("oGValue", GValue)
Parameters.SetAttributeInteger("oBValue", BValue)