Tutorial 1: Essential skills

To access the tutorials in ArcGIS CityEngine, start CityEngine and click Help > Download Tutorials and Examples... in the main menu. After choosing a tutorial or example, the project is automatically downloaded and added to your CityEngine workspace.

Building with random height value of 56.79 with roofHip roof

In this tutorial, you'll learn the essential skills needed when working with CityEngine, such as creating a scene, selecting objects, and editing rules.

Create a project

First, you'll create a CityEngine project.

  1. Click File > New > CityEngine > CityEngine Project to open the Select a wizard dialog box.

    New project

  2. Click Next.
  3. In the Project name box, type MyFirstCity.

    Project name MyFirstCity.

  4. Click Finish.

    The MyFirstCity project is created in the Navigator.

    MyFirstCity in Navigator

Create a scene

Next, you'll create a scene.

  1. Click File > New > CityEngine > CityEngine Scene or right-click the \MyFirstCity\scenes\ folder and select New > CityEngine Scene to open the Select a wizard dialog box again.

  2. Click Next.
  3. In the File name box, type myFirstCity_01.cej.

    Scene name MyFirstCity_01.cej

  4. Keep the Coordinate System box empty.

    For more information on coordinate systems, see Georeferencing.

  5. Click Finish.

    The MyFirstCity_01.cej scene is created in the \MyFirstCity\scenes\ folder.

    MyFirstCity_01.cej in Navigator

Copy rules and assets

Now you'll copy files from the downloaded Tutorial_01_Essential_Skills project folder into the MyFirstCity project.

  1. Click the \Tutorial_01_Essential_Skills\rules\ folder to expand it.
  2. Select the contents in the folder and press Ctrl+C or right-click and select Copy to copy the contents.

    Rules copied from tutorial folder

  3. Click the \MyFirstCity\rules\ folder and press Ctrl+V or right-click and select Paste to paste the contents into the \rules\ folder.

    Paste files in MyFirstCity

  4. Repeat the same steps for the \Tutorial_01_Essential_Skills\assets\ folder.

    The \assets\ and \rules\ folders in the MyFirstCity project now contain the necessary Tutorial_1_Essential_Skills content.

Create your first street layout

After you have set up your new project and scene, you are ready to create your first street layout. To learn more about streets, see Graphs.

To create a street network, do the following:

  1. Click the Viewport to make it the active window.
  2. Click Graph > Grow Streets to open the Grow Streets dialog box.

    Grow Streets Basic Settings dialog box

  3. Keep the default settings and click Apply.
  4. Click Close to close the dialog box.

    You have now created around 500 streets or more.

  5. Press A or click the Frame Viewport button Frame Viewport on the CityEngine toolbar to frame the streets in the Viewport.

    Viewport Perspective View display of grown streets

  6. Click the new Streetnetwork layer in the Scene Editor to expand the layer.

    The Streetnetwork layer contains a network of blocks, graph segments, and shapes.

    Scene Editor with the Streetnetwork layer expanded

    In the Tutorial_01_Essential_Skills project folder, open the Essential_Skills_Part_2.cej scene to see the finished example.

Navigation

In this section, you will learn how to navigate in CityEngine, including panning, rotating, and zooming.

To navigate in CityEngine, use the following actions:

Tumble or rotate the scene.

  • Click the Tumble/Rotate button Rotate.
  • Press Alt+click.

Move the view left, right, up, or down.

  • Click the Pan/Track button Pan.
  • Press Alt+click the wheel button.
  • Press the arrow keys.

Dolly/zoom the camera toward or away from the point of interest.

  • Click the Dolly/Zoom button Zoom.
  • Press Alt and right-click.

Rotate the view from the current camera position. This can help create bookmarks that 360 VR exports.

  • Click the Look around button Look around.
  • Press B+click.

See 3D navigation essentials for a complete list of actions and how to change the mouse and navigation settings.

Selection

You use the Select tool Select tool to select, interact with, and edit objects in your scene. Click the Select tool Select tool or press Q. You can also click Select > Select Tool in the CityEngine main menu to open the tool.

Use the selection actions in the following table:

Click

Selects an individual object. On an already selected object, components are selected (faces, edges, or vertices).

Double-click

Selects and frames an individual object.

Left-to-right selection rectangle

Selects objects or components that are fully inside the selection rectangle. Map layers are not added to the selection.

Right-to-left selection rectangle

Selects objects that intersect with the selection rectangle. Map layers are not added to the selection.

Note:
  • The left-to-right selection is usually used to select tiny objects such as street graph nodes when there are many objects occupying the same space.
  • Use the F9 and F12 keys to turn the visibility on or off for Map LayersGraph SegmentsShapes, and Models. When you deactivate the visibility of other object types, this simplifies making the proper selection.

After objects are selected, you can right-click and display the context menu:

Selection context menu

Frame (F)

Frame the selection (or the whole scene if the selection is empty).

Select Objects in Same Layer

All objects in the same layer or layers are selected.

Select Objects with Same Rule File

Selects all objects having assigned a rule file that is present in the source selection.

Select Objects with Same Start Rule

Selects all objects having a start rule that is present in the source selection.

Generate models with rules

CityEngine is a procedural modeling application and uses CGA rules. Computer Generated Architecture (CGA) is a unique programming language specified to generate architectural 3D content. In the following section, you will learn how to use CGA rules to generate models.

Model Generation diagram

  1. In the Viewport, select a block.

    Under Block Parameters in the Inspector, the type attribute is set to Recursive Subdivision.

    Inspector Block Parameters dialog box

  2. Click the type attribute drop-down menu and change it to Offset Subdivision.

    Change to Offset Subdivision

    For more information on block subdivision and dynamic city layouts, see Tutorial 2: Terrain and dynamic city layouts.

  3. Select a shape within the block.
  4. Click Select > Select Objects of Same Group in the main menu.

    Shapes within block selected

  5. Drag the building.cga rule file in the \rules\ folder onto the selected shapes.

    Assign rule file

    After dropping the rule file onto the shapes, the rule is applied and the models generate automatically.

    Viewport perspective view of buildings generated after the rule on the shapes has been applied

    Under Visibility settings Visibility settings , ensure the models are visible by clicking the Models button or pressing F12.

    Model visibility

  6. Delete a model and add it back into the scene.
    1. Select a building and press Delete or right-click and select Delete.

      This removes the model.

    2. Select the footprint shape again, and click the Generate button Generate on the toolbar or press Ctrl+G to generate the building again from the footprint.
  7. To see variations of the building height, click the Update Seed button Update seed or press Ctrl+Shift+G to change the seed value.

    The image below shows the building with different seed values for height:

    Examples of different seed values for height

  8. Change the height attribute to 60 in the Inspector.
    Inspector rules height parameter set to 60

    When you manually change attributes in the Inspector, the attribute is highlighted and overrides the definitions in the CGA rule.

  9. To reset the attributes for the building.cga rule, hover over any of the attributes in the Inspector and right-click and select Reset user attributes.

    Reset user attributes

    Open the Essential_Skills_Part_4.cej scene to see a finished example.

Edit rules

The CGA Editor is a tool to create and modify 3D models for all city types such as modern to contemporary, from ancient to futuristic. Next, you'll explore the buidling.cga rule.

  1. To open the building.cga rule in the CGA Editor, double-click the CGA rule file in the Navigator or click the Rule File link in the Inspector.
    Inspector shapes rule file building.cga

    The building.cga rule opens in the CGA Editor.

    Building.cga rule in the Rule Editor

  2. Inspect the building.cga rule.

    The height attribute is defined as a random value between 15 and 25.

    attr height = rand(15,25)

    In the example below, the building has a random height value of 18.35.

    Building with random height value of 18.35

    Note:

    Since the building.cga rule generates a random value, it will be different in your scene.

  3. Change the random height end value to 80.
    attr height = rand(15,80)

    The height attribute is now defined as a random value between 15 and 80.

    1. Press Ctrl+S or right-click the rule file and select Save to save the edited rule.
    2. Regenerate the building by clicking the Update Seed button Update seed or pressing Ctrl+Shift+G.
      Building with random height value of 56.79

      The building now has a random height value of 56.79.

      Note:

      Use the Update Seed tool because the height is a random value and the random seed value must be updated when regenerating the building.

  4. Create roof geometry by adding the new Roof rule to the building.cga rule:
    1. Edit the Lot rule until it looks like the following rule:
      Lot -->
       	case shapeType == "LotInner" : 
       		 Lot.
       	else :
       	  extrude(height) comp(f) { side :  Facade | top:  Roof }
    2. Add the Roof rule and define the shape as roofHip with an angle of 22.5 degrees.
      Roof --> roofHip(22.5) Shape
    3. Save the rule.
  5. Regenerate the building, but instead click the Generate Models button Generate or press Ctrl+G. This keeps the building height at 56.79.

    Building with random height value of 56.79 with roofHip roof

    The Essential_Skills_Part_5.cej scene shows a finished example.

You've learned how to create a project and scene, add streets, navigate and select, generate models, and edit rules. Learn more about CityEngine by continuing with other tutorials.