<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic cga Building Rules in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484917#M6558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;I'm new to CityEngine but I've made some progress learning the program by reviewing some of the tutorials.&amp;nbsp; I received a building footprint zip file from the Southeast Michigan Council of Governments (SEMCOG) that contains a shape file package.&amp;nbsp; The package .dbf file has building square footage, number of stories, building height etc (see attached).&amp;nbsp; Can you provide or identify the location of a .cga file that I can use or modify in my project to extrude the buildings to the correct configuration? I've used some of the .cga building rules in some of the examples without much luck.&amp;nbsp; Most of the footprints are ok but various buildings have the incorrect number of floors and heights.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;&lt;A class="jive-link-email-small" href="mailto:mlnelson2@charter.net"&gt;mlnelson2@charter.net&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jun 2016 18:04:40 GMT</pubDate>
    <dc:creator>MichaelNelson3</dc:creator>
    <dc:date>2016-06-17T18:04:40Z</dc:date>
    <item>
      <title>cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484917#M6558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;I'm new to CityEngine but I've made some progress learning the program by reviewing some of the tutorials.&amp;nbsp; I received a building footprint zip file from the Southeast Michigan Council of Governments (SEMCOG) that contains a shape file package.&amp;nbsp; The package .dbf file has building square footage, number of stories, building height etc (see attached).&amp;nbsp; Can you provide or identify the location of a .cga file that I can use or modify in my project to extrude the buildings to the correct configuration? I've used some of the .cga building rules in some of the examples without much luck.&amp;nbsp; Most of the footprints are ok but various buildings have the incorrect number of floors and heights.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;&lt;A class="jive-link-email-small" href="mailto:mlnelson2@charter.net"&gt;mlnelson2@charter.net&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 18:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484917#M6558</guid>
      <dc:creator>MichaelNelson3</dc:creator>
      <dc:date>2016-06-17T18:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484918#M6559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you use the median height to extrude, you first have to convert it from feet to meter, since CE only uses that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr MEDIAN_HEIGHT = 0 #connect this attribute
@Hidden
attr MEDIAN_HM = MEDIAN_HEIGHT/3.2808 #feet to meter

Lot --&amp;gt;
&amp;nbsp; extrude(MEDIAN_HM)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have faulty data, you could use some case checking to "fix" it, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr MEDIAN_HEIGHT = 0
attr MEDIAN_HM = MEDIAN_HEIGHT/3.2808
attr FixHeight = 10 # in feet

Lot --&amp;gt;
&amp;nbsp; case MEDIAN_HEIGHT == 0: FixBuilding
&amp;nbsp; else: ExtrudeBuilding

ExtrudeBuilding --&amp;gt;
&amp;nbsp; extrude(MEDIAN_HM)

FixBuilding --&amp;gt;
&amp;nbsp; set(MEDIAN_HEIGHT, FixHeight)
&amp;nbsp; ExtrudeBuilding&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use something like &lt;STRONG&gt;STORIES*storyheight&lt;/STRONG&gt; (if it exists) as building height.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:22:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484918#M6559</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2021-12-11T21:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484919#M6560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried revising the attached Building_From_Footprint.cga rule file so it would extrude all building footprints contained in a shape file package I received from the Southeast Michigan Council of Governments (SEMCOG) using the number of stories (column "STORIES") and building height (column "MEDIAN_HEIGHT") information in the .dbf file without any luck.&amp;nbsp; I'm not a programmer but I've reviewed the tutorials and I just do not get it.&amp;nbsp; Can someone modify the attached Building_From_Footprint.cga rule file such that it correctly extrudes the building footprints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried revising the attached Standard_Street.cga rule file so it would create the correct number of lanes for all of the streets contained in a shape file package I received from the Southeast Michigan Council of Governments (SEMCOG) file package using the number of lanes (column "NUMBER_LAN") information in the .dbf file without any luck.&amp;nbsp; Can someone also modify the attached Standard_Street.cga file such that it correctly builds the streets with the correct number of lanes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 18:41:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484919#M6560</guid>
      <dc:creator>MichaelNelson3</dc:creator>
      <dc:date>2016-07-26T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484920#M6561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll take a look, but can you post your zip file, or a sample of it? Also what version of CityEngine are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 04:34:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484920#M6561</guid>
      <dc:creator>DevinLavigne</dc:creator>
      <dc:date>2016-07-27T04:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484921#M6562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Attached is a copy of the zip files.&amp;nbsp; I'm using CityEngine 2015.2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 11:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484921#M6562</guid>
      <dc:creator>MichaelNelson3</dc:creator>
      <dc:date>2016-07-29T11:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484922#M6563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it wasn't behaving right for me either - so don't be hard on yourself. When an attribute is named to match a GIS field, the connection should happen automatically. For your data, it wasn't, which was odd - maybe it was the size of the data? Anyway, there is a way to map those attributes manually - see the help file for Connection Editor. Once they were mapped the code below worked perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="s1"&gt;const&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;unitScale&lt;/SPAN&gt; = &lt;SPAN class="s1"&gt;case&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;Unit&lt;/SPAN&gt;==&lt;SPAN class="s4"&gt;"Feet"&lt;/SPAN&gt;: 0.3048006096012192 &lt;SPAN class="s1"&gt;else&lt;/SPAN&gt;: 1

&lt;SPAN class="s5"&gt;@Range&lt;/SPAN&gt;&lt;SPAN class="s6"&gt;(&lt;/SPAN&gt;"Feet"&lt;SPAN class="s6"&gt;, &lt;/SPAN&gt;"Meters"&lt;SPAN class="s6"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="s1"&gt;attr&lt;/SPAN&gt;&lt;SPAN class="s6"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;Unit&lt;/SPAN&gt;&lt;SPAN class="s6"&gt; = &lt;/SPAN&gt;"Feet"

&lt;SPAN class="s5"&gt;@Range &lt;/SPAN&gt;(0.5,200)
&lt;SPAN class="s1"&gt;attr&lt;/SPAN&gt;&lt;SPAN class="s6"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;STORIES&lt;/SPAN&gt;&lt;SPAN class="s6"&gt; = 0 &lt;/SPAN&gt;#Should be a GIS Driven Attribute but I had to "Connect" it manually

&lt;SPAN class="s5"&gt;@Range &lt;/SPAN&gt;(0,10000)
&lt;SPAN class="s1"&gt;attr&lt;/SPAN&gt;&lt;SPAN class="s6"&gt; MEDIAN_HGT = 0 &lt;/SPAN&gt;#Should be a GIS Driven Attribute but I had to "Connect" it manually

@Hidden
&lt;SPAN class="s1"&gt;attr&lt;/SPAN&gt; MEDIAN_HGT_feet = MEDIAN_HGT * &lt;SPAN class="s2"&gt;unitScale&lt;/SPAN&gt;

@StartRule
&lt;SPAN class="s7"&gt;Footprints&lt;/SPAN&gt;--&amp;gt;&amp;nbsp; &lt;SPAN class="s7"&gt;extrude&lt;/SPAN&gt;(MEDIAN_HGT_feet)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s7"&gt;split&lt;/SPAN&gt;(y) {MEDIAN_HGT_feet/&lt;SPAN class="s3"&gt;STORIES&lt;/SPAN&gt;:&lt;SPAN class="s8"&gt;Floor&lt;/SPAN&gt;}* #comment this out if you don't want floors/horizontal splits&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2016-07-30 at 2.31.18 AM.png" class="image-1 jive-image" height="543" src="/legacyfs/online/213912_Screen Shot 2016-07-30 at 2.31.18 AM.png" style="height: 545px; width: 1294.64px;" width="1292" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also saw something that was odd and - see above - the building has 20 stories, but the Median Height of the building is only 124 feet. So just a point of caution. Another note, the building in the foreground is 4.5 stories, in case you were wondering what was going on with the short top floor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Devin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484922#M6563</guid>
      <dc:creator>DevinLavigne</dc:creator>
      <dc:date>2021-12-11T21:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: cga Building Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484923#M6564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You provided some pretty simple, yet extremely valuable information.&amp;nbsp; I was wondering why my buildings were extruding artificially high, all the while not realizing CE defaults to meters.&amp;nbsp; Obviously I needed to convert my data to feet, but I must have missed that in the tutorials I was following ... in any event, I am appreciative of your post.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2020 18:29:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-building-rules/m-p/484923#M6564</guid>
      <dc:creator>Brownschuh</dc:creator>
      <dc:date>2020-03-05T18:29:11Z</dc:date>
    </item>
  </channel>
</rss>

