<?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 Setting a slider value from within the code in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310848#M4269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to set the slider value from within the code but then still be able to modify the slider/attribute value manualy affterwards?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets say that i have a generic rule which defines several building typologyes. If every typology has a different number of floors i would normaly set the "number_of_floors" attribute within the typology definition to a certain valuey using "set" comand and then extrude.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr number_of_floors&amp;nbsp; = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Building_type_1 --&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;set(number_of_floors, 5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude (floor_height*number_of_floors)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Building_type_2 --&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; set(number_of_floors, 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude (floor_height*number_of_floors)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should be just a starting point, showing the defalut settup (default number of floors/height) which you should be able to manually edit using parameters afterwards. But in this case the "number_of_floors" attribute gets assigned a certain value within the code and is not possible to edit it with the slider anymore, ie. the modifying the slider values dont affect the model generation anymore. Is there a way just the set, lets say "user" attribute value and not "rule" value?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2013 06:35:52 GMT</pubDate>
    <dc:creator>AleksandarLalovic</dc:creator>
    <dc:date>2013-07-17T06:35:52Z</dc:date>
    <item>
      <title>Setting a slider value from within the code</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310848#M4269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to set the slider value from within the code but then still be able to modify the slider/attribute value manualy affterwards?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets say that i have a generic rule which defines several building typologyes. If every typology has a different number of floors i would normaly set the "number_of_floors" attribute within the typology definition to a certain valuey using "set" comand and then extrude.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr number_of_floors&amp;nbsp; = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Building_type_1 --&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;set(number_of_floors, 5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude (floor_height*number_of_floors)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Building_type_2 --&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; set(number_of_floors, 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude (floor_height*number_of_floors)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should be just a starting point, showing the defalut settup (default number of floors/height) which you should be able to manually edit using parameters afterwards. But in this case the "number_of_floors" attribute gets assigned a certain value within the code and is not possible to edit it with the slider anymore, ie. the modifying the slider values dont affect the model generation anymore. Is there a way just the set, lets say "user" attribute value and not "rule" value?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 06:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310848#M4269</guid>
      <dc:creator>AleksandarLalovic</dc:creator>
      <dc:date>2013-07-17T06:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a slider value from within the code</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310849#M4270</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;STRONG&gt;CGA can not dictate the attribute source&lt;/STRONG&gt;&lt;SPAN&gt;. CGA gets the attribute values to work with.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;==&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the Connection Editor dictates, which value is used. There's just the 4 states 'Rule', 'User', 'Object Attr' [[or 'Mapped']].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in your case, I'd create a second attribute which dictates the source for your attribute of interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

@Hidden // = generic attribute to transport the info
attr finalValue = 0

@Range ( "Rule", "User", "Object" )
attr useWhichAttr = "Rule"

attr ruleDefaultValue = rand(10,20) // connection : attr source = "rule"

attr userValue = rand(10,20)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // connection : attr source = "user" // = you playing with slider

attr objectAttrValue = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // value initialized with 0&amp;nbsp; // connection : attr source = "object" 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Lot --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case useWhichAttr == "Rule" :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(finalValue, ruleDefaultValue )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GoExtrude
&amp;nbsp;&amp;nbsp;&amp;nbsp; case useWhichAttr == "User" :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(finalValue, userValue ) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GoExtrude 
&amp;nbsp;&amp;nbsp;&amp;nbsp; else :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(finalValue, objectAttrValue )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GoExtrude

GoExtrude --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; extrude( finalValue )
&amp;nbsp;&amp;nbsp;&amp;nbsp; Done.

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like this, you control all possibilities.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:52:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310849#M4270</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-11T14:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a slider value from within the code</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310850#M4271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good to know. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 08:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/setting-a-slider-value-from-within-the-code/m-p/310850#M4271</guid>
      <dc:creator>AleksandarLalovic</dc:creator>
      <dc:date>2013-07-19T08:01:40Z</dc:date>
    </item>
  </channel>
</rss>

