Writing a Rule File

After creating a new rule file, the file is automatically opened in the editor. Existing files can be opened by double-clicking them in the Navigator or via File→ Open


A rule file is a collection of attributes, functions and rules.



In order to use the rule file, one of the rules must be named the same as the shape's start rule.

Here is the example from the CityEngine Basic Tutorial:
/**
 * File:    building_01.cga
 * Created: 31 Oct 2008 10:47:50 GMT
 * Author:  andi
 */

attr minheight = 10
attr maxheight = 30
attr floorheight = 3
attr windowwidth = 2

Lot --> extrude(rand(minheight,maxheight)) Components

Components --> comp(f){top : Roof. | side : Facade}

Facade --> split(y){~floorheight : Floor}*

Floor --> split(x){~windowwidth : Window}*

Window --> i("modern_window.obj")

Do not forget to save the file via File→ Save or File→ Save As.

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