General InformationThis opening ID is used to customize the color of an insulation based on the type of a feature on which insulation is applied.
Input ObjectsInput objects must be of the following types:
SampleThe 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_SurfaceInsulation(InsSurfaceInsulationFeature)
let INS_ProfileInsulation(InsProfileInsulationFeature)
let RValue(Integer)
let GValue(Integer)
let BValue(Integer)
set INS_SurfaceInsulation = Parameters.GetAttributeObject("INSFeatureType")
set INS_ProfileInsulation = Parameters.GetAttributeObject("INSFeatureType")
if(NULL <> INS_SurfaceInsulation)
{
//Check the children first and go to top in hierarchy
Let oIns(InsInsulation)
Let oRepRef(VPMRepReference)
Let sCategory(String)
//Notify(INS_SurfaceInsulation.Name)
oRepRef = GetPLMOwner(INS_SurfaceInsulation)
Set oIns = oRepRef.AggregatingReference
sCategory = oIns.V_Categories->GetItem(1)
if(sCategory == "A-0")
{
RValue = 0
GValue = 128
BValue = 128
}
else
{
RValue = 0
GValue = 250
BValue = 200
}
// you can add more conditions by retrieving the attributes
}
if(NULL <> INS_ProfileInsulation)
{
//Check the children first and go to top in hierarchy
Let oIns(InsInsulation)
Let oRepRef(VPMRepReference)
Let sCategory(String)
//Notify(INS_ProfileInsulation.Name)
oRepRef = GetPLMOwner(INS_ProfileInsulation)
Set oIns = oRepRef.AggregatingReference
sCategory = oIns.V_Categories->GetItem(1)
if(sCategory == "B-0")
{
RValue = 0
GValue = 100
BValue = 200
}
else
{
RValue = 0
GValue = 130
BValue = 220
}
// you can add more conditions by retrieving the attributes
}
Parameters.SetAttributeInteger("oRValue", RValue)
Parameters.SetAttributeInteger("oGValue", GValue)
Parameters.SetAttributeInteger("oBValue", BValue)
Note:
This rule is executed using the Publish Insulations
command.
| |||||||||||||||