<?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: pls pls   way to set  block type  with python in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206637#M10624</link>
    <description>&lt;P&gt;Wow wow&lt;/P&gt;&lt;P&gt;Really thank you , really thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry , can i question one more ?&lt;/P&gt;&lt;P&gt;models = ce.getObjectsFrom(ce.scene , ce.isgeneratedModel)&lt;/P&gt;&lt;P&gt;I generate model in a certain block&lt;/P&gt;&lt;P&gt;And i would like to select genrated model only&lt;/P&gt;&lt;P&gt;Like this&lt;/P&gt;&lt;P&gt;models = ce.getObjectsFrom(ce.scene , ce.isgeneratedModel)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that possible ?&lt;/P&gt;&lt;P&gt;Sorry many ask&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 05:26:24 GMT</pubDate>
    <dc:creator>JeoCho</dc:creator>
    <dc:date>2022-08-26T05:26:24Z</dc:date>
    <item>
      <title>pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1205935#M10621</link>
      <description>&lt;P&gt;hi&amp;nbsp; friends&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need help ~&lt;/P&gt;&lt;P&gt;pls pls pls&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to set&amp;nbsp; block type.&lt;/P&gt;&lt;P&gt;i tried this way&lt;/P&gt;&lt;P&gt;&amp;nbsp;ce.setAttribute(block,'/ce/block/SKELETON',2)&lt;/P&gt;&lt;P&gt;ce.setAttribute(block,'/ce/block/RECURSIVE',0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but not working .&lt;/P&gt;&lt;P&gt;how can i set block type with python ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 16:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1205935#M10621</guid>
      <dc:creator>JeoCho</dc:creator>
      <dc:date>2022-08-24T16:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206633#M10623</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/611535"&gt;@JeoCho&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The attribute is "/ce/block/type"&lt;/P&gt;&lt;P&gt;And the possible values are:&lt;BR /&gt;"Skeleton Subdivision", "Recursive Subdivision", ... (Same as in the inspector)&lt;/P&gt;&lt;P&gt;If the attribute is not shown as &lt;STRONG&gt;bold &lt;/STRONG&gt;in the inspector you need to not only set the value of the attribute you also need to set the source of the attribute to user.&lt;/P&gt;&lt;P&gt;Here is an example, I adapted it from the &lt;A href="https://doc.arcgis.com/en/cityengine/latest/python/python-parameters-and-attributes.htm#ESRI_SECTION1_7758C322B9D04F89AE0E139011809B3D" target="_self"&gt;python docs&lt;/A&gt; to match your case&lt;/P&gt;&lt;LI-CODE lang="python"&gt;block = ce.getObjectsFrom(ce.selection)[0]
ce.setAttribute(block,"/ce/block/type", "Offset Subdivision")
ce.setAttributeSource(block,"/ce/block/type", "USER")&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 05:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206633#M10623</guid>
      <dc:creator>JonasObertuefer</dc:creator>
      <dc:date>2022-08-26T05:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206637#M10624</link>
      <description>&lt;P&gt;Wow wow&lt;/P&gt;&lt;P&gt;Really thank you , really thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry , can i question one more ?&lt;/P&gt;&lt;P&gt;models = ce.getObjectsFrom(ce.scene , ce.isgeneratedModel)&lt;/P&gt;&lt;P&gt;I generate model in a certain block&lt;/P&gt;&lt;P&gt;And i would like to select genrated model only&lt;/P&gt;&lt;P&gt;Like this&lt;/P&gt;&lt;P&gt;models = ce.getObjectsFrom(ce.scene , ce.isgeneratedModel)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that possible ?&lt;/P&gt;&lt;P&gt;Sorry many ask&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 05:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206637#M10624</guid>
      <dc:creator>JeoCho</dc:creator>
      <dc:date>2022-08-26T05:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206647#M10625</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;Sure this is also possible. You just need to change your filter from &lt;EM&gt;ce.isgeneratedModel &lt;/EM&gt;(this is no valid filter!) to &lt;EM&gt;ce.isModel&lt;/EM&gt;. And then select it using &lt;EM&gt;ce.setSelection()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# all generated models in scene
models = ce.getObjectsFrom(ce.scene, ce.isModel)
ce.setSelection (models)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shapes which have a rule file assigned but aren't generated won't be included in the &lt;EM&gt;ce.isModel&lt;/EM&gt; filter.&lt;/P&gt;&lt;P&gt;cheers&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 06:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206647#M10625</guid>
      <dc:creator>JonasObertuefer</dc:creator>
      <dc:date>2022-08-26T06:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206649#M10626</link>
      <description>&lt;P&gt;really really thank thank thank you for&amp;nbsp; answering&lt;/P&gt;&lt;P&gt;i made this script&amp;nbsp;&lt;/P&gt;&lt;P&gt;but error,&amp;nbsp;&lt;/P&gt;&lt;P&gt;really really sorry&amp;nbsp; , pls can you check this 2 script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. this is script to select&amp;nbsp; &amp;nbsp;( select&amp;nbsp; generated model&amp;nbsp; &amp;nbsp;in&amp;nbsp; selected block)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;but error&lt;/P&gt;&lt;P&gt;from scripting import *&lt;BR /&gt;ce = CE()&lt;/P&gt;&lt;P&gt;def selectblock() :&lt;BR /&gt;oneblock = ce.getObjectsFrom(ce.selection, ce.isBlock)&lt;BR /&gt;lots = ce.getObjectsFrom(oneblock[0] , ce.ismodel)&lt;BR /&gt;ce.setSelection(lots)&lt;BR /&gt;if __name__ == '__main__':&lt;BR /&gt;selectblock()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; this is layer isolate script&lt;/P&gt;&lt;P&gt;&amp;nbsp;that is error also&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from scripting import *&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ce = CE()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;@noUIupdate&lt;BR /&gt;def main():&lt;BR /&gt;sele = ce.getObjectsFrom(ce.selection, ce.isLayer)&lt;BR /&gt;layers = ce.getObjectsFrom(ce.scene, ce.isLayer)&lt;BR /&gt;&lt;BR /&gt;for layer in layers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;really&amp;nbsp; really sorry&amp;nbsp; &amp;nbsp;sorry&amp;nbsp; for many ask&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;layer.setVisible(False)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if sele :&lt;BR /&gt;sele.setVisible(True)&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;BR /&gt;main()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 06:50:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1206649#M10626</guid>
      <dc:creator>JeoCho</dc:creator>
      <dc:date>2022-08-26T06:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1209637#M10640</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;First script:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is a typo. instead of ce.ismodel you have write ce.isModel.&lt;/LI&gt;&lt;LI&gt;If you want to get the shapes of the block instead write ce.isShape&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Second script:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is no layer.setVisible()&lt;/LI&gt;&lt;LI&gt;you need to use &lt;A href="https://doc.arcgis.com/en/cityengine/latest/python/ce.htm#ESRI_SECTION1_534D97F2CA674D0C87E094ED2EB38A16" target="_self"&gt;ce.setLayerPreferences()&lt;/A&gt; for what you want to do&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Some general advice:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you encounter errors check the message in the log, usually gives a good idea about what could be wrong&lt;/LI&gt;&lt;LI&gt;Use print statements to debug&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 08:40:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1209637#M10640</guid>
      <dc:creator>JonasObertuefer</dc:creator>
      <dc:date>2022-09-05T08:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: pls pls   way to set  block type  with python</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1209642#M10642</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 09:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/pls-pls-way-to-set-block-type-with-python/m-p/1209642#M10642</guid>
      <dc:creator>JeoCho</dc:creator>
      <dc:date>2022-09-05T09:13:20Z</dc:date>
    </item>
  </channel>
</rss>

