To access the tutorial projects in ArcGIS CityEngine, open 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.
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.
- Click File > New > CityEngine > CityEngine Project to open the Select a wizard dialog box.
- Click Next.
- In the Project name box, type MyFirstCity.
- Click Finish.
The MyFirstCity project is created in the Navigator.
Create a scene
Next, you'll create a scene.
- 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.
- Click Next.
- In the File name box, type myFirstCity_01.cej.
- Keep the Coordinate System box empty.
For more information on coordinate systems, see Georeferencing.
- Click Finish.
The MyFirstCity_01.cej scene is created in the \MyFirstCity\scenes\ folder.
Copy rules and assets
Now you'll copy files from the downloaded Tutorial_01_Essential_Skills project into the MyFirstCity project.
- Click the \Tutorial_01_Essential_Skills\rules\ folder to expand it.
- Select the contents in the folder and press Ctrl+C or right-click and select Copy to copy the contents.
- Click the \MyFirstCity\rules\ folder and press Ctrl+V or right-click and select Paste to paste the contents into the \rules\ folder.
- Repeat the same steps for the \Tutorial_01_Essential_Skills\assets\ folder.
The \assets\ and \rules\ folders in the MyFirstCity project now contains 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:
- Click the Viewport to make it the active window.
- Click Graph > Grow Streets to open the Grow Streets dialog box.
- Keep the default settings and click Apply.
- Click Close to close the dialog box.
You have now created around 500 streets or more.
- Press A or click the Frame Viewport tool on the CityEngine toolbar to frame the streets in the Viewport.
- 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.
In the \Tutorial_01_Essential_Skills\ project folder, open the Essential_Skills_Part_2.cej scene to see the finished example.
Explore CityEngine 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. |
|
Move the view left, right, up, or down. |
|
Dolly/zoom the camera toward or away from the point of interest. |
|
Rotate the view from the current camera position. This can help create bookmarks that 360 VR exports. |
|
See 3D navigation essentials for a complete list of actions and how to change the mouse and navigation settings. |
Select objects
You use the Select tool to select, interact with, and edit objects in your scene. Click the Select tool (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 Layers, Graph Segments, Shapes, 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:
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.
- In the Viewport, select a block.
Under Block Parameters in the Inspector, the Subdivision Type attribute is set to Recursive Subdivision.
- Click the Subdivision Type attribute drop-down menu and change it to Offset Subdivision.
For more information on block subdivision and dynamic city layouts, see Tutorial 2: Terrain and dynamic city layouts.
- Select a shape within the block.
- Click Select > Select Objects of Same Group in the main menu.
- Drag the building.cga rule file in the \rules\ folder onto the selected shapes.
After dropping the rule file onto the shapes, the rule is applied and the models generate automatically.
Under Visibility settings , ensure the models are visible by clicking the Models button or pressing F12.
- Delete a model and add it back into the scene.
- Select a building and press Delete or right-click and select Delete.
This removes the model.
- Select the footprint shape again, and click the Generate tool (Ctrl+G) on the toolbar to generate the building again from the footprint.
- Select a building and press Delete or right-click and select Delete.
- To see variations of the building height, click the Update Seed tool (Ctrl+Shift+G) to change the seed value.
The image below shows the building with different seed values for height:
- Change the height attribute to 60 in the Inspector.
When you manually change attributes in the Inspector, the attribute is highlighted and overrides the definitions in the CGA rule.
- 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.
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.
- 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.
The building.cga rule opens in the CGA Editor.
- 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.
Note:
Since the building.cga rule generates a random value, it will be different in your scene.
- 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.
- Press Ctrl+S or right-click the rule file and select Save to save the edited rule.
- Regenerate the building by clicking the Update Seed tool (Ctrl+Shift+G).
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.
- Create roof geometry by adding the new Roof rule to the building.cga rule:
- 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 }
- Add the Roof rule and define the shape as roofHip with an angle of 22.5 degrees.
Roof --> roofHip(22.5) Shape
- Save the rule.
- Edit the Lot rule until it looks like the following rule:
- Regenerate the building, but instead click the Generate Models tool (Ctrl+G). This keeps the building height at 56.79.
The Essential_Skills_Part_5.cej scene shows a finished example.
In this tutorial, you've learned how to create a project and scene, add streets, navigate and select, generate models, and edit rules.
To continue your learning with CityEngine, see the complete CityEngine tutorial catalog.