Using Styles

CGA rule files with styles allow users to quickly choose a set of predefined parameters using the Style Manager.

Style keyword

# -- facade.cga
...
attr Window_Width = 1.2
attr Door_Height = 2.5

...
// all your Facade CGA rules
...

style Facade_Wide
attr Window_Width = 2.2
attr Door_Height = 2.8        
By adding a new style using the style keyword and a style name, a new "namespace" is defined. All definitions below the style keyword are valid for this style only.


In the example above the attr Window_Width, which was set to 1.2 in the Default Style is overwritten to 2.2 in the style Facade_Wide.

extends keyword

# -- facade.cga
...
attr Window_Width = 1.2
attr Door_Height = 2.5

...
// all your Facade CGA rules



style Facade_Wide
attr Window_Width = 2.2
attr Door_Height = 2.8

style Facade_Wide_2 extends Facade_Wide
attr Window_Width = 2.4


style Facade_Wide_3
attr Window_Width = 2.4

A style can be extended from an existing style. An extended style will inherit all definitions from its parent style.
In the example above, style Facade_Wide_2 inherits Door_Height from its parent Facade_Wide (value results in 2.8)

Style Facade_Wide_3, which does not extend, will inherit its value for Door_Height from the default style (resutling in 2.5).

All styles, if extended or not implicitly extend the default style.

 

CGA Reference

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.