<?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: Mass insert 3D model at preference point in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753546#M9928</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Btw. you could of course also directly create an attribute which describes the asset path to the building as a string in your GIS application. Then you don't have to make the mapping function in CityEngine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2012 10:39:25 GMT</pubDate>
    <dc:creator>MatthiasBuehler1</dc:creator>
    <dc:date>2012-10-09T10:39:25Z</dc:date>
    <item>
      <title>Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753544#M9926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a layer of points, each with an unique ID. I have a file which maps the point ID to the building model's file name. What I want to do now is to write a rule file which takes the ID and produce the file name, then use i(file name) to insert the model at the points.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My questions are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- is there any way to implement a hash function in cga grammar?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- is there any looping mechanism in cga?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- if it is impossible to achieve what I want using rule file, what are the other options I have? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to City Engine, so please pardon my lack of knowledge. Thanks for your time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2012 08:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753544#M9926</guid>
      <dc:creator>Thu_GiangDang</dc:creator>
      <dc:date>2012-10-09T08:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753545#M9927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 'loop' you mention is done automatically by running a rule 'on all shapes', by using 1 rule on multiple shapes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you may have noticed, each attributed GIS point ('point feature') is converted to a tiny little shape.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now if you have an ID for each building - which comes in as an Object Attr - you can use this ID string in a function to point CGA to the correct file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check Tutorial 3 !&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://video.arcgis.com/watch/1769/tutorial-3-map-control" rel="nofollow noopener noreferrer" target="_blank"&gt;http://video.arcgis.com/watch/1769/tutorial-3-map-control&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. like this. change to attr and asset names to your specific names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[the code may contain errors. I did not check it.]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

assetFinder(ID) =
&amp;nbsp;&amp;nbsp;&amp;nbsp; case ID == "abcd" : "assets/building_abcd.dae"
&amp;nbsp;&amp;nbsp;&amp;nbsp; case ID == "efgh" : "assets/building_edgh.dae"
&amp;nbsp;&amp;nbsp;&amp;nbsp; ..
&amp;nbsp;&amp;nbsp;&amp;nbsp; else: "builtin:cube"

attr BuildingID = "" # Point to Object Attribute with the actual ID info.

Lot --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; alignScopeToAxes()
&amp;nbsp;&amp;nbsp;&amp;nbsp; s(0,0,0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; i(assetFinder(BuildingID))
&amp;nbsp;&amp;nbsp;&amp;nbsp; center(xz)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Building.

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:58:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753545#M9927</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-12T07:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753546#M9928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Btw. you could of course also directly create an attribute which describes the asset path to the building as a string in your GIS application. Then you don't have to make the mapping function in CityEngine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2012 10:39:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753546#M9928</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-10-09T10:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753547#M9929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your solution. For now what I did was I manually assigned the different start rule for different points and use the case-else grammar to get the correct file path, but your method is way better. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the full point feature class is quite big (around 500), and the mapping information is store elsewhere (I'm trying to export it into an excel file or a text file). If there is anyway of reading the value directly from the file and do mapping it would be better in term of effort and also better for maintenance, if later on the data is updated or more models are added in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your time!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 07:46:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753547#M9929</guid>
      <dc:creator>Thu_GiangDang</dc:creator>
      <dc:date>2012-10-10T07:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753548#M9930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;loading those attributes from a text file is possible with Python scripting, by parsing the file, reading the value, then setting the value as either object attribute or as a user set value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ Python scripting is available in CityEngine Advanced, not Basic. ]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 12:12:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753548#M9930</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-10-10T12:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mass insert 3D model at preference point</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753549#M9931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your answer!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 00:46:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/mass-insert-3d-model-at-preference-point/m-p/753549#M9931</guid>
      <dc:creator>Thu_GiangDang</dc:creator>
      <dc:date>2012-10-11T00:46:00Z</dc:date>
    </item>
  </channel>
</rss>

