<?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: Can I prevent automatic model generation when changing user attributes with python? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329931#M4545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is possible!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.noUIupdate.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.noUIupdate.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Python Scripting Interface Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;noUIupdate&lt;/STRONG&gt;(f)&lt;TT&gt; Decorator to mark a function as non-UI updating.&lt;BR /&gt; By decorating a function with @noUIupdate: the function&lt;BR /&gt; will be executed on the UI thread thus preventing UI updates.&lt;/TT&gt;&lt;TT&gt;&lt;BR /&gt; Note: # mark setAttributes() to run faster without UI updates &lt;/TT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;TT&gt;&lt;STRONG&gt;@noUIupdate&lt;/STRONG&gt;
 def setAttributes():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in ce.&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.CE.html#CE-getObjectsFrom" rel="nofollow noopener noreferrer" target="_blank"&gt;getObjectsFrom&lt;/A&gt;(ce.selection, ce.isShape):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.CE.html#CE-setAttribute" rel="nofollow noopener noreferrer" target="_blank"&gt;setAttribute&lt;/A&gt;(shape, 'height', 15)

 if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setAttributes()&lt;/TT&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:37:46 GMT</pubDate>
    <dc:creator>ThomasFuchs</dc:creator>
    <dc:date>2021-12-11T15:37:46Z</dc:date>
    <item>
      <title>Can I prevent automatic model generation when changing user attributes with python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329930#M4544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to change an attribute in a bunch of shapes and then generate all the models at once after the shapes had their attribute set. However CE generates each model separately while running through the loop, resulting in a rather slow process. Can I somehow prevent this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = getObjectsFrom(ce.selection, ce.isShape)&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in shapes:&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttributeSource(shape, "/ce/rule/someAttribute", "USER")&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttribute(shape, "/ce/rule/someAttribute", "hello")&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.generateModels(shapes, False, True)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329930#M4544</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2021-12-11T15:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can I prevent automatic model generation when changing user attributes with python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329931#M4545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is possible!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.noUIupdate.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.noUIupdate.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Python Scripting Interface Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;noUIupdate&lt;/STRONG&gt;(f)&lt;TT&gt; Decorator to mark a function as non-UI updating.&lt;BR /&gt; By decorating a function with @noUIupdate: the function&lt;BR /&gt; will be executed on the UI thread thus preventing UI updates.&lt;/TT&gt;&lt;TT&gt;&lt;BR /&gt; Note: # mark setAttributes() to run faster without UI updates &lt;/TT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;TT&gt;&lt;STRONG&gt;@noUIupdate&lt;/STRONG&gt;
 def setAttributes():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in ce.&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.CE.html#CE-getObjectsFrom" rel="nofollow noopener noreferrer" target="_blank"&gt;getObjectsFrom&lt;/A&gt;(ce.selection, ce.isShape):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.&lt;A href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/manual/python/jscripting/jscripting.CE.html#CE-setAttribute" rel="nofollow noopener noreferrer" target="_blank"&gt;setAttribute&lt;/A&gt;(shape, 'height', 15)

 if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setAttributes()&lt;/TT&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329931#M4545</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2021-12-11T15:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can I prevent automatic model generation when changing user attributes with python?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329932#M4546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 22:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/can-i-prevent-automatic-model-generation-when/m-p/329932#M4546</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2016-03-30T22:57:20Z</dc:date>
    </item>
  </channel>
</rss>

