Hi all!
I'm wondering if there is a way to use the StreetWidth attribute so that setbacks can be based on the width of the street the lot side is facing. For instance, if it's a corner lot, I want to have a larger setback for the side that's facing a wider street and a smaller one for the side that's facing a narrower street.
Any pointers will be greatly appreciated! Thank you!
Lesi
In 2019.0, you can create custom edge attributes manually in the Inspector by adding new object attributes. Edge attributes must have the prefix /edgeattr/. When creating an edge attribute, choose an array type (BOOL[], FLOAT[], or STR[]) and enter in as many values as you have edges, and terminate each value with a semicolon. After the edge attribute has been created, you can also change a value for an edge in the Inspector by selecting the individual edge.
For example, if I had a triangle shape and I wanted to create an edge attribute for the color of each edge, I would create the following edge attribute.
Edge attributes can also be created using Python using ce.setAttribute.
On non-dynamic shapes (shapes not created by street networks), you can calculate edge attributes for each shape using the built in menu option (Shapes -> Compute Edge Attributes). This uses the nearest streets to calculate information like /edgeattr/orientations, /edgeattr/streetcategories, and /edgeattr/streetwidths.
https://doc.arcgis.com/en/cityengine/latest/help/help-compute-attributes.htm
In CGA, you can access these edge attributes using edgeAttr.getFloat(), edgeAttr.getString(), edgeAttr.getBool().
https://doc.arcgis.com/en/cityengine/latest/cga/cga-edge-attr-function.htm
In the triangle example above, I could color the edges of the triangle using edgeAttr.getString("color").
comp(fe) { all: color(edgeAttr.getString("color")) primitiveCube s('1, w, w) center(yz) Edge. }