<?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: adjust attr of CGA rule by python script in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626086#M8335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12.6px;"&gt;Dear Cheryl Lau,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12.6px;"&gt;Sorry to disturb you again, recently I tried what you suggested. It work well by Option 1. But when I adopted Option3, I met a problem and I can't fix it. Now code became :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;def addh():&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects = ce.getObjectsFrom( ce.selection, ce.isShape)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for o in objects:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h= ce.getAttribute(o, '/ce/rule/height')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addh = h+5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttributeSource(o,'/ce/rule/height', 'USER')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttribute(o, '/ce/rule/height', addh)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I had reset the height attribute once( became user-set once), it will suceed running python script to adjust it but it adjusted user-set value not rule-set value( for ex., I reset it before as 10, then return the value source to rule-set as 6.123456, but after running the script, which use the previous value 10 + 5 = 15 not 6.123456+5 = 11.123456 ). &lt;SPAN style="text-decoration: underline;"&gt;Is it possible for script to read the current value not only the user-set value we set before?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and if I never reset it or just assign one new shape with this rule, I ran the script and the value showed '&lt;STRONG&gt;NaH&lt;/STRONG&gt;'-- none.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;So for that I consider the problem comes from &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;getAttribute()&lt;/SPAN&gt;.&lt;/STRONG&gt; The user-set value and rule-set value are independent, which means if I assign one new shape with this rule, the rule-set is 6.123456 but user-set remain empty, so when running script it showed NaH. &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;getAttribute() &lt;/STRONG&gt;can only read user-set value, right? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want everything work within python script and is it possible to read current value without problems above? And for option2, I don't know why need to export objects??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Mar 2016 03:54:32 GMT</pubDate>
    <dc:creator>HangyuChen</dc:creator>
    <dc:date>2016-03-28T03:54:32Z</dc:date>
    <item>
      <title>adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626083#M8332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want to test how python attr. and para. api work and adjust "height" by python. &lt;/P&gt;&lt;P&gt;so I wrote cga :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;attr height = 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Lot --&amp;gt;&amp;nbsp;&amp;nbsp; extrude(height) Mass.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and python script:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def addheight():&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects= ce.getObjectsFrom(ce.selection, ce.isModel)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for o in objects:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print o&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h= ce.getAttribute(o, 'height')&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print h&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addh= h+10&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttribute(o, 'height', addh)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I hope it can add 10 on height of each building but it returns &lt;STRONG&gt;None&lt;/STRONG&gt;. Through debugging, I found "o" is ok (when I choose 5 shapes, 2 shapes without rules, it can report those 3 shapes assigned with rule)&amp;nbsp; &lt;/P&gt;&lt;P&gt;However, it shows [ ] no attribute in "o" (by getAtrributeSource).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;so How CAN I get the Attribute defined in the rule by myself and use it in Python Script ????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;If Possible, Could anyone help me finish this simple python script???&amp;nbsp;&amp;nbsp; (just get "height" and add 10 then return the value back to adjust building)????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!!!!&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Feb 2016 11:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626083#M8332</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2016-02-13T11:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626084#M8333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, attributes should be set on shape objects (instead of models):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;objects = ce.getObjectsFrom(ce.selection, ce.isShape)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, the rule attribute name should be preceded by "/ce/rule/":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;h = ce.getAttribute(o, '/ce/rule/height')&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, rule attributes only appear in the list returned by ce.getAttributeList() if they are user set.&amp;nbsp; This means we can only set them in Python if we first make them user-set attributes.&amp;nbsp; There are two options for this.&amp;nbsp; The first option (a simple workaround) is good if this is just a one time operation that you'd like to do because it involves manually setting the attribute.&amp;nbsp; The second option is more complicated but will work if you'd like everything to work within the python script without having to set anything manually.&amp;nbsp; In this case, we make the attributes user-set by way of an extra python script that is run from your first python script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Select your shapes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Set the height attribute in the Inspector to 10.&amp;nbsp; This is the value it already was set to by the rules, but by resetting it through the Inspector we are making a user-set attribute instead of a rule-set attribute.&amp;nbsp; The number now appears bold indicating that it is a user set attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Now you can run the python script (with the two changes above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create an export python script.&amp;nbsp; Right click on the scripts folder -&amp;gt; New -&amp;gt; Python Module -&amp;gt; Select Module:Export (Reporting) and choose a name (e.g. coexport.py).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) In the finishModel() function, add the following code to make the attribute a user set attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;ce.setAttributeSource(shape, "/ce/rule/height", "USER")&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) In your first python script, add some lines (after you get the objects but before the for loop) to run the export script you just created:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;expSettings = ScriptExportModelSettings()&lt;BR /&gt;expSettings.setScript("coexportscript.py")&lt;BR /&gt;ce.export(objects, expSettings)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Now you can run the first python script (with the two changes above).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 10:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626084#M8333</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2016-02-15T10:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626085#M8334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, there might be an easier way than Option 2.&amp;nbsp; It might be possible to just set the source to user in the first python script in which case the second python script is unnecessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) In the first python script, do this to set the source to user before setting the value of the attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;ce.setAttributeSource(o, "/ce/rule/height", "USER")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;ce.setAttribute(o, "/ce/rule/height", addh)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Now you can run the python script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 16:37:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626085#M8334</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2016-02-17T16:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626086#M8335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12.6px;"&gt;Dear Cheryl Lau,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12.6px;"&gt;Sorry to disturb you again, recently I tried what you suggested. It work well by Option 1. But when I adopted Option3, I met a problem and I can't fix it. Now code became :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;def addh():&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects = ce.getObjectsFrom( ce.selection, ce.isShape)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for o in objects:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h= ce.getAttribute(o, '/ce/rule/height')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addh = h+5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttributeSource(o,'/ce/rule/height', 'USER')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setAttribute(o, '/ce/rule/height', addh)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If I had reset the height attribute once( became user-set once), it will suceed running python script to adjust it but it adjusted user-set value not rule-set value( for ex., I reset it before as 10, then return the value source to rule-set as 6.123456, but after running the script, which use the previous value 10 + 5 = 15 not 6.123456+5 = 11.123456 ). &lt;SPAN style="text-decoration: underline;"&gt;Is it possible for script to read the current value not only the user-set value we set before?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and if I never reset it or just assign one new shape with this rule, I ran the script and the value showed '&lt;STRONG&gt;NaH&lt;/STRONG&gt;'-- none.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;So for that I consider the problem comes from &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;getAttribute()&lt;/SPAN&gt;.&lt;/STRONG&gt; The user-set value and rule-set value are independent, which means if I assign one new shape with this rule, the rule-set is 6.123456 but user-set remain empty, so when running script it showed NaH. &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;getAttribute() &lt;/STRONG&gt;can only read user-set value, right? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want everything work within python script and is it possible to read current value without problems above? And for option2, I don't know why need to export objects??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 03:54:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626086#M8335</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2016-03-28T03:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626087#M8336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your guess is correct.&amp;nbsp; Unfortunately, it is not possible to get rule-set attribute values this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there is a workaround (which is not so easy) if you need to access the rule-set attribute values.&amp;nbsp; This involves reporting the attribute's value in the cga code and reading that reported value in python.&amp;nbsp; Use option 2, and in step 2, add the following code to the finishModel() method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;h = model.getReports()["height"][0]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get value of height from reports&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;ce.setAttribute(shape, "/ce/rule/height", h+5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add 5 to height&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;ce.setAttributeSource(shape, "/ce/rule/height", "USER")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set source to USER (since value doesn't come from rules anymore)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, report the value of the rule-set attribute height in your cga code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;Lot --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extrude(height)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mass.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reports&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;Reports --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; report("height", height)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NIL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do we need to export objects?&amp;nbsp; No reason really, but this is just the workaround that I found works.&amp;nbsp; Perhaps there is another way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 13:31:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626087#M8336</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2016-03-29T13:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626088#M8337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cheryl Lau,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Appriciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I will try it now!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 00:25:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626088#M8337</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2016-03-30T00:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626089#M8338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12.6px;"&gt;Dear Cheryl Lau,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last time I succeed on adjusting attr. Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&lt;SPAN style="color: #3d3d3d; font-family: Arial; font-size: 10pt;"&gt;ow &lt;/SPAN&gt;I meet new problem on different condition. By&amp;nbsp; "import" I can import sub-CGA into main-CGA with its attr.&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt; Is it possible to get Attribute of sub-CGA by Python Script?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;I write two cga:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;##### Lot.cga ##### &lt;SPAN style="color: #3d3d3d; font-family: Arial; font-size: 10pt; text-decoration: underline;"&gt;&lt;EM&gt;sub-CGA&lt;/EM&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;attr h= 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Lot--&amp;gt; extrude(h)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;##### Box.cga #####&lt;SPAN style="color: #3d3d3d; font-family: Arial; font-size: 10pt; text-decoration: underline;"&gt; &lt;EM&gt;main-CGA &lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;attr h2= 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;import X:"Lot.cga"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;import Y:"Lot.cga"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Lot--&amp;gt; split(x){~5:X.Lot|~5:Y.Lot}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;##########&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 12.6px; text-decoration: underline;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;As you can see, X and Y come from the same cga "Lot.cga" with attr h. Also main-CGA&amp;nbsp; "Box.cga" has one attr h2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;all I adjust to USER-Attribute as Fig.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;IMG alt="DoubleAttrAPI.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201809_DoubleAttrAPI.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I try to getAttribute in console, but only h2--&amp;gt; successful show 10,&amp;nbsp; h --&amp;gt; None. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;STRONG&gt;How can I get these two values of h?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 15:55:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626089#M8338</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2016-05-23T15:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626090#M8339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get and set the values of attributes in imported cga files if the attributes are user-set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;ce.setAttribute(shape, &lt;/SPAN&gt;&lt;EM style="color: #00aa00; font-size: 10.0pt; font-family: 'Courier New';"&gt;'/ce/rule/X.h'&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: maroon;"&gt;8&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;ce.setAttributeSource(shape, &lt;/SPAN&gt;&lt;EM style="color: #00aa00; font-size: 10.0pt; font-family: 'Courier New';"&gt;'/ce/rule/X.h'&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;, &lt;/SPAN&gt;&lt;EM style="color: #00aa00; font-size: 10.0pt; font-family: 'Courier New';"&gt;'USER'&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;(ce.getAttribute(shape, &lt;/SPAN&gt;&lt;EM style="color: #00aa00; font-size: 10.0pt; font-family: 'Courier New';"&gt;'/ce/rule/X.h'&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a note:&amp;nbsp; I don't think there is a need to import the same cga file twice.&amp;nbsp; You only have to import it once, then you can re-use the X.Lot rule.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #600060;"&gt;Lot&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; --&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #600060;"&gt;split&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;(x){~5:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #600060;"&gt;X.Lot&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;|~5:&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #600060;"&gt;X.Lot&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 08:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626090#M8339</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2016-05-25T08:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: adjust attr of CGA rule by python script</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626091#M8340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I want to change the color of roof, how can I do? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2019 21:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/adjust-attr-of-cga-rule-by-python-script/m-p/626091#M8340</guid>
      <dc:creator>FanjieKong</dc:creator>
      <dc:date>2019-02-06T21:10:10Z</dc:date>
    </item>
  </channel>
</rss>

