Color ID (AGTColorID)

An opening ID is an entry point used to customize business logic. Color ID manages the color and transparency of various accommodation design features such as walls, ceilings, coverings, sills, etc.

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 create an accommodation design feature, or edit its material, thickness, or category.

DefinitionDescription
PLM Opening IDAGTColorID
Customization intent Computation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject: Feature
  • Parameters: RuleContext.

Sample

The following sample explains the business rule for applying color and transparency to various accommodation design objects.

/*
ThisObject Type = FeatureVPMReference
Parameters Type = RuleContext
*/
/* Initialize Input featue*/
let AGT_Wall(AGTWall)
let AGT_Covering(AGTCovering)
let AGT_Ceiling(AGTCeiling)
let AGT_Sill(AGT2Sill)
let AGT_Connector(AGT2Connector)
let AGT_Covering_Panel_Set(AGT2CoveringPanelSet)

let Category(String)
let MyMaterial(String)
let MyColor(String)
let RValue(Integer)
let GValue(Integer)
let BValue(Integer)
let AValue(Integer)

/*Initialize to invalid values (<0 or >255) so that these are returned by default*/
RValue = 999
GValue = 999
BValue = 999

AValue = 255

set AGT_Wall = Parameters.GetAttributeObject("AGTFeatureType")
set AGT_Ceiling = Parameters.GetAttributeObject("AGTFeatureType")
set AGT_Covering = Parameters.GetAttributeObject("AGTFeatureType")
set AGT_Sill = Parameters.GetAttributeObject("AGTFeatureType")
set AGT_Connector = Parameters.GetAttributeObject("AGTFeatureType")
set AGT_Covering_Panel_Set = Parameters.GetAttributeObject("AGTFeatureType")
/* Retrieve the Category from Feature */
if( NULL <> AGT_Wall)
{
	if(AGT_Wall->IsASortOf("CabinAreaWall"))
	{
		RValue = 0
		GValue = 255
		BValue = 0
	}
	else if(AGT_Wall->IsASortOf("PublicAreaWall"))
	{
		RValue = 110
		GValue = 110
		BValue = 255
	}
	else if(AGT_Wall->IsASortOf("ServiceAreaWall"))
	{
		RValue = 0
		GValue = 110
		BValue = 110
		AValue = 150
	}
	else
	{
		RValue = 255
		GValue = 0
		BValue = 0
	}
}

if( NULL <> AGT_Ceiling)
{
	if(AGT_Ceiling->IsASortOf("CabinAreaCeiling"))
	{
		RValue = 0
		GValue = 67
		BValue = 100
		
	}
	else if(AGT_Ceiling->IsASortOf("PublicAreaCeiling"))
	{
		RValue = 50
		GValue = 86
		BValue = 98
	}
	else if(AGT_Ceiling->IsASortOf("ServiceAreaCeiling"))
	{
		RValue = 0
		GValue = 86
		BValue = 98
	}
	else
	{
		RValue = 100
		GValue = 110
		BValue = 100
	}
}

if( NULL <> AGT_Covering)
{
	if(AGT_Covering->IsASortOf("PublicAreaCovering"))
	{
		RValue = 100
		GValue = 67
		BValue = 100
	}
	else if(AGT_Covering->IsASortOf("CabinAreaCovering"))
	{
		RValue = 100
		GValue = 167
		BValue = 100
	}
	else if(AGT_Covering->IsASortOf("ServiceAreaCovering"))
	{
		RValue = 110
		GValue = 86
		BValue = 0
	}
	else
	{
		RValue = 60
		GValue = 100
		BValue = 100
	}
}

if( NULL <> AGT_Sill)
{
	if(AGT_Sill->IsASortOf("GenericSill"))
	{
		RValue = 100
		GValue = 67
		BValue = 100
	}
	else if(AGT_Sill->IsASortOf("WallSill"))
	{
		RValue = 100
		GValue = 167
		BValue = 100
	}
	else
	{
		RValue = 60
		GValue = 100
		BValue = 100
	}
}

if( NULL <> AGT_Connector)
{
	if(AGT_Connector->IsASortOf("GenericConnector"))
	{
		RValue = 100
		GValue = 67
		BValue = 100
	}
	else if(AGT_Connector->IsASortOf("WallConnector"))
	{
		RValue = 100
		GValue = 167
		BValue = 100
	}
	else
	{
		RValue = 60
		GValue = 100
		BValue = 100
	}
}

if( NULL <> AGT_Covering_Panel_Set)
{
	MyMaterial = AGT_Covering_Panel_Set.Material 
	if(MyMaterial like "White Tile")
	{
		RValue = 255
		GValue = 0
		BValue = 0
	}
	 else if (MyMaterial like "Persian carpet")
	{
		RValue = 0
		GValue = 255
		BValue = 0
	}
	 else if (MyMaterial like "Oak")
	{
		RValue = 0
		GValue = 0
		BValue = 255
	  	AValue = 110
	}
}

Parameters.SetAttributeInteger("oRValue", RValue)
Parameters.SetAttributeInteger("oGValue", GValue)
Parameters.SetAttributeInteger("oBValue", BValue)
Parameters.SetAttributeInteger("oAValue", AValue)