Select to view content in your preferred language

City Engine to Arcpro -Export Parcel to GIS

359
2
Jump to solution
10-20-2025 02:50 AM
Tiwene_Roberts
New Contributor

 

 

Im learning by doing with limited knowledge and experience. The code snippet below I've used to use and offset distance from the boundary to create an inner parcel.

What I'm having trouble with is being able to export the resulting face (boundary) geomentry of the inner lot to gis as a layer. 

Any suggestions? Thanks in advance

 

// inner_parcel_export.cga

// ------------------------------------------------------

// Purpose: Create an inner parcel offset inward from all boundaries by 1 m

// and mark it for export to GIS (e.g., as shapefile or GDB).

// ------------------------------------------------------

 

// -----------------

// Attributes

// -----------------

attr offsetDist = 1.0 // inward offset distance in meters

attr subparcel = 0 // attribute flag: 1 = inner parcel

attr parcelType = "outer" // attribute tag: outer/inner

 

// -----------------

// Start Rule

// -----------------

@StartRule

Lot -->

// Assign attributes to the outer parcel

set(subparcel, 0)

set(parcelType, "outer")

// Offset inward by offsetDist to create a new shape

offset(-offsetDist) InnerBoundary

 

// -----------------

// Inner boundary component handling

// -----------------

InnerBoundary -->

// Split geometry into inside and border parts

comp(f) {

inside : InnerParcel

| border : OuterParcel

}

 

// -----------------

// Inner parcel definition

// -----------------

InnerParcel -->

set(subparcel, 1)

set(parcelType, "inner")

color("#ffcc99")

// Keep as polygon shape for GIS export (no extrusion)

 

// -----------------

// Outer parcel definition (optional visualization only)

// -----------------

OuterParcel -->

set(parcelType, "outer")

color("#99ccff")

 

0 Kudos
1 Solution

Accepted Solutions
ThomasFuchs
Esri Regular Contributor

Hello @Tiwene_Roberts 

Thanks for sharing your code snippet—it's awesome that you're diving in and learning by doing with CityEngine. I understand the challenge of exporting that inner parcel boundary as a GIS layer. I'll walk you through a straightforward solution below.

When exporting a Model to FileGDB, it is not possible to only select certain faces of a Model. Therefore, all face geometries in the CGA code, that you do not want to export, have to be NILed.
NIL operation—ArcGIS CityEngine Resources | Documentation

// -----------------
// Outer parcel definition (optional visualization only)
// -----------------

OuterParcel --> NIL
// set(parcelType, "outer")
// color("#99ccff")

Then Export to the model to FileGDB and make sure to only export Models:
Export FileGDB (Esri File Geodatabase)—ArcGIS CityEngine Resources | Documentation

ThomasFuchs_0-1760965536536.png

 



View solution in original post

2 Replies
ThomasFuchs
Esri Regular Contributor

Hello @Tiwene_Roberts 

Thanks for sharing your code snippet—it's awesome that you're diving in and learning by doing with CityEngine. I understand the challenge of exporting that inner parcel boundary as a GIS layer. I'll walk you through a straightforward solution below.

When exporting a Model to FileGDB, it is not possible to only select certain faces of a Model. Therefore, all face geometries in the CGA code, that you do not want to export, have to be NILed.
NIL operation—ArcGIS CityEngine Resources | Documentation

// -----------------
// Outer parcel definition (optional visualization only)
// -----------------

OuterParcel --> NIL
// set(parcelType, "outer")
// color("#99ccff")

Then Export to the model to FileGDB and make sure to only export Models:
Export FileGDB (Esri File Geodatabase)—ArcGIS CityEngine Resources | Documentation

ThomasFuchs_0-1760965536536.png

 



Tiwene_Roberts
New Contributor

Hello Thomas,

Thank you kindly for your solution it worked perfectly not to mention a better understanding of the application. ✌

0 Kudos