<?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 ce.selection does not seem treat all objects selected? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/ce-selection-does-not-seem-treat-all-objects/m-p/376441#M5200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The script I want to write simply changes an object attribute value for all selected objects but what I find is that it will do 1, I assume the first one it finds, and ignores all of the rest. The case is that I select a number of parcel polygons and run the script, only one has had the "Pop" attribute changed to the value I specify, i.e. 99, the rest of the polygons do not change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is rather simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ce = CE()
thePop = 1000
print ce.selection()
ce.setAttribute(ce.selection()[0], 'Pop', 99)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "print ce.selection()" line does return the proper number of objects but only one gets the Pop attribute modified. What am I missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 20:27:57 GMT</pubDate>
    <dc:creator>LoringTupper</dc:creator>
    <dc:date>2014-06-06T20:27:57Z</dc:date>
    <item>
      <title>ce.selection does not seem treat all objects selected?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/ce-selection-does-not-seem-treat-all-objects/m-p/376441#M5200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The script I want to write simply changes an object attribute value for all selected objects but what I find is that it will do 1, I assume the first one it finds, and ignores all of the rest. The case is that I select a number of parcel polygons and run the script, only one has had the "Pop" attribute changed to the value I specify, i.e. 99, the rest of the polygons do not change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is rather simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ce = CE()
thePop = 1000
print ce.selection()
ce.setAttribute(ce.selection()[0], 'Pop', 99)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "print ce.selection()" line does return the proper number of objects but only one gets the Pop attribute modified. What am I missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 20:27:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/ce-selection-does-not-seem-treat-all-objects/m-p/376441#M5200</guid>
      <dc:creator>LoringTupper</dc:creator>
      <dc:date>2014-06-06T20:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: ce.selection does not seem treat all objects selected?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/ce-selection-does-not-seem-treat-all-objects/m-p/376442#M5201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, my mistake, so I'm answering my own enquiry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The line should not read "ce.setAttribute(ce.selection() [0], 'Pop', 99)" but rather "ce.setAttribute(ce.selection, 'Pop', 99)". No "() [0]" is required, this would limit the setAttribute function to the first item in the selection set, removing that it allowed the setAttribute to act on all objects in the selection.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 20:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/ce-selection-does-not-seem-treat-all-objects/m-p/376442#M5201</guid>
      <dc:creator>LoringTupper</dc:creator>
      <dc:date>2014-06-06T20:39:09Z</dc:date>
    </item>
  </channel>
</rss>

