Set Rule Attribute in Export Script

Discussion created by hjd_uk on Mar 8, 2013
Latest reply on Mar 14, 2013 by AUlmer-esristaff
Hi, im trying to use a rule-attribute to enable and disable the report() calls during shape generation so that I dont waste time amd memory creating report data that i only need during export.

If I manually set the attribute to true before exporting it works, trying to set it in the Python script however, fails.

I have a main.cga which imports my report.cga.

The report.cga declares an attribute and the rule that does the reporting is a selection rule:
attr bEnableExportReport = false
ReportData --> case bEnableExportReport == true: Report() else : NIL

In my export script I set the attribute to True in the "initModel" using '/ce/rule/report.bEnableExportReport' (before model is generated), but even though the attribute does get set to True (i am using ce.getAttribute() to make sure ), the script and rule behaves as if the attribute is still False - therefore no report-data.

I have tried setting the attributeScope to 'RULE' before setting the value to true to make sure its using the rule-scope attribute.

I have also tried setting the other attribute '/ce/rule/bEnableExportReport' - is this the Shape's version ? [ why are there two attributes on the shape for the same attr ? ]

Is there a "flush-attributes" command I should call to make the attributes get relfected to the shape/rules?