<?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 Re: CityEngine Python Scripting: Batch grow streets and export as shape file in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31163#M439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how owe did you get on with this? I'm looking at getting roads generated from city engine into Infraworks and this would be really useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Aug 2017 06:48:08 GMT</pubDate>
    <dc:creator>deleted-user-qCpyynw67wg8</dc:creator>
    <dc:date>2017-08-13T06:48:08Z</dc:date>
    <item>
      <title>CityEngine Python Scripting: Batch grow streets and export as shape file</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31162#M438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm fairly new to CityEngine but am hoping to build a python script that will allow me to batch grow a series of street networks (with some set parameters) and export each street network to a shape file as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;Start a new scene&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;Do while i &amp;lt; 100&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -growstreets(with some parameters)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -select streets &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -export streets as .shp file with name: "streets" &amp;amp; i &amp;amp; ".shp"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -select streets&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -delete streets&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i ++&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;I'm not new to programming but I am new to CityEngine and python. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;I assume this is possible? !If anyone could point me in the direction of some suitable examples it would be much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;Many Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;Stephen&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;edit: I am playing with ce.growStreets(graph, settings) - however this function requires that I specify a graph from which streets are grown. Using the UI I can simply graph-&amp;gt;grow streets in a blank world - can someone suggest how I do the same thing in a script (i.e. not pass a graph or pass an empty one). Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;edit2: OK - I am slowly moving forwards here - the following will create a new street network each time it is run, now i just need to export , delete the layer etc. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; scripting &lt;SPAN style="color: #0433ff;"&gt;import&lt;/SPAN&gt; *&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb; padding-left: 30px;"&gt;# get a CityEngine instance&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;ce = CE()&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&lt;SPAN style="color: #0433ff;"&gt;def&lt;/SPAN&gt; test():&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newGraph = ce.addGraphLayer(&lt;SPAN style="color: #00b400;"&gt;'new'&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.growStreets(newGraph)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; __name__ == &lt;SPAN style="color: #00b400;"&gt;'__main__'&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; test()&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;pass&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;At this stage I'm unsure if a mod should delete this thread - but perhaps it will be use to someone else just starting out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit3: Close to a final solution - if I am doing this in a very cumbersome way please let me know &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #00b400;"&gt;'''&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #00b400;"&gt;Created on Jul 11, 2014&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #00b400;"&gt;@author: Stephen&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #00b400;"&gt;'''&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; scripting &lt;SPAN style="color: #0433ff;"&gt;import&lt;/SPAN&gt; *&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;# get a CityEngine instance&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;ce = CE()&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #0433ff;"&gt;def&lt;/SPAN&gt; batchGrowStreets():&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;for&lt;/SPAN&gt; i &lt;SPAN style="color: #0433ff;"&gt;in&lt;/SPAN&gt; range(&lt;SPAN style="color: #941100;"&gt;1&lt;/SPAN&gt;,&lt;SPAN style="color: #941100;"&gt;11&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##Create a new graph layer&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newGraph = ce.addGraphLayer(&lt;SPAN style="color: #00b400;"&gt;'new'&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##Grow streets on it&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.growStreets(newGraph)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##Select them&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph = ce.getObjectsFrom(ce.scene)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##setup the export file&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportSettings = SHPExportGraphSettings()&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exportSettings.setFilename(ce.toFSPath(&lt;SPAN style="color: #00b400;"&gt;"testCE"&lt;/SPAN&gt; + str(i) + &lt;SPAN style="color: #00b400;"&gt;".shp"&lt;/SPAN&gt;))&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##Export graph as shape file&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.export(graph, exportSettings)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #cbcbcb;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;##delete everything&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.delete(ce.getObjectsFrom(ce.scene))&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; __name__ == &lt;SPAN style="color: #00b400;"&gt;'__main__'&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; batchGrowStreets()&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;pass&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 01:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31162#M438</guid>
      <dc:creator>StephenCondors</dc:creator>
      <dc:date>2014-07-11T01:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: CityEngine Python Scripting: Batch grow streets and export as shape file</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31163#M439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how owe did you get on with this? I'm looking at getting roads generated from city engine into Infraworks and this would be really useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Aug 2017 06:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31163#M439</guid>
      <dc:creator>deleted-user-qCpyynw67wg8</dc:creator>
      <dc:date>2017-08-13T06:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: CityEngine Python Scripting: Batch grow streets and export as shape file</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31164#M440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neil,&lt;/P&gt;&lt;P&gt;Thank you for your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CityEngine is a versatile software that supports export to Autodesk data formats:&lt;/P&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/infraworks/learn-explore/caas/CloudHelp/cloudhelp/ENU/InfraWorks-UserHelp/files/GUID-3B510DC4-54DF-40BC-B997-480433562B53-htm.html" title="https://knowledge.autodesk.com/support/infraworks/learn-explore/caas/CloudHelp/cloudhelp/ENU/InfraWorks-UserHelp/files/GUID-3B510DC4-54DF-40BC-B997-480433562B53-htm.html"&gt;Supported File-Based Data Formats | InfraWorks | Autodesk Knowledge Network&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a suggestion for each data type:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For exporting &lt;STRONG&gt;Graph Segments&lt;/STRONG&gt; use &lt;EM&gt;AutoCAD DXF&lt;/EM&gt; refer: &lt;A class="link-titled" href="http://cehelp.esri.com/help/index.jsp?topic=/com.procedural.cityengine.help/html/manual/sn/export/toc.html" title="http://cehelp.esri.com/help/index.jsp?topic=/com.procedural.cityengine.help/html/manual/sn/export/toc.html"&gt;CE Help - Exporting Graph Segments&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;For exporting &lt;STRONG&gt;Street Shapes&lt;/STRONG&gt; also use &lt;EM&gt;AutoCAD DXF&lt;/EM&gt; refer: &lt;A class="link-titled" href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/is/export/toc.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/is/export/toc.html"&gt;CE Help - Exporting Shapes&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;For exporting &lt;STRONG&gt;Street Models&lt;/STRONG&gt; generated with e.g. &lt;A class="link-titled" href="https://www.arcgis.com/home/item.html?id=e2ebb6eab2dd4a28805eb8cc2c56b185" title="https://www.arcgis.com/home/item.html?id=e2ebb6eab2dd4a28805eb8cc2c56b185"&gt;CE Example Complete Streets 2016&lt;/A&gt;&amp;nbsp; you could use&amp;nbsp;&lt;EM&gt;Autodesk FBX &lt;/EM&gt;refer: &lt;A class="link-titled" href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/export/export_toc.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/export/export_toc.html"&gt;CE Help - Exporting Models&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these exporters can be automated with CityEngine Python &lt;A class="link-titled" href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting_cat.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting_cat.html"&gt;CE Help - Python Scripting Category Commands&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cityengine-python-scripting-batch-grow-streets-and/m-p/31164#M440</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2017-08-15T15:24:31Z</dc:date>
    </item>
  </channel>
</rss>

