Global attributes/variables

Discussion created by pltsltesri on Feb 28, 2013
Latest reply on Mar 20, 2013 by pltsltesri
Is there a way to set a global attribute/variable? What I want to do is set a attribute/variable in one rule and then use that variable within an imported rule. The case is that I have a central rule that gets the land use type from an attribute in a geodatabase layer then imports rules that are executed depending on the landuse value. I want to use the same material opacity in all cases so I would like to set that attribute value in the main rule then use it in each of the landuse rules. If I want to change the opacity I can then just set it in the main rule.

Rule A:
attr LANDUSE = " "

attr Opacity1 = .2

## importing.cga
import ruleC2: "C-2.cga"
import ruleC3: "C-3.cga"
import ruleC3_23: "C-3_23.cga"

case PROPERTY_USE == "C-2" : ruleC2.Lot
case PROPERTY_USE == "C-3" : ruleC3.Lot
case PROPERTY_USE == "C-3(23)" : ruleC3_23.Lot
else: NIL

C-2.cga rule:
"Some stuff..."
set(material.opacity, Opacity1)