<?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: Conditional Rules in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124826#M1702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I am getting some beautiful stairs, unfortunately there still seems to be one slight problem as shown in the image, when I am generating a model on a hill, some sides have a base below them and some don't. This results in the sides having different numbers so that when I do a case(myIndex) to get stairs forming on sides with doors, it doesn't count the sides which don't have a base and so my stairs end up on different places to my doors! Do you know a way to fix this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2012 03:53:57 GMT</pubDate>
    <dc:creator>JoanneO_Brien</dc:creator>
    <dc:date>2012-08-22T03:53:57Z</dc:date>
    <item>
      <title>Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124821#M1697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible and if so how can you create a case function which would say something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;attr steps = "#FFFFFF"&amp;nbsp; //have shown this as colour but actually want to have steps as a&amp;nbsp; //recursion extruding away from the BaseSide if possible.&amp;nbsp; BaseVolume --&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comp(f) {side : BaseSide(comp.index) | bottom : NIL | top : extrude(height - Roof_Height) Mass }&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseSide (myIndex) --&amp;gt; case myIndex == 3 &amp;amp;&amp;amp; scope.sx &amp;gt;= 1.5: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; split(x) {~1: color(grey) | 1.5 : color(steps) | ~1 color(grey)} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else : color(grey)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This currently isn't working but would love it to! I've attached a screenshot of one of my doors, although of course every building which has a BaseSide would have different heights below the door hence I'd love to work out using the recursion rule here too since then it could decide how many steps are needed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've also been trying to work out if there is a better way of assigning where the door goes but at the moment all I can come up with is telling it to put the door on wall number three, where ever that might be. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ultimately it'd be so nice to be able to select a wall manually and then say right I'd like to use this code on this wall but that code on the others but I don't believe this is possible...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 02:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124821#M1697</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-08-13T02:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124822#M1698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ultimately it'd be so nice to be able to select a wall manually and then say right I'd like to use this code on this wall but that code on the others but I don't believe this is possible...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This was what I was thinking (btw. that was the intention of starting &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/64264-Can-a-path-to-other-CGA-rule-file-be-passed-as-a-parameter"&gt;this topic&lt;/A&gt;&lt;SPAN&gt;. If you could pass a path to fasade-specific rule file as a building attribute and if you could also pass the index of the wall to use the rule as an other attribute then it would be it. The base rule file would need to be a bit compilcated but I don't see any other way. And so far I haven't been able to do it this way...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 06:11:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124822#M1698</guid>
      <dc:creator>LechKar_owicz</dc:creator>
      <dc:date>2012-08-13T06:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124823#M1699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did not get your point of the recursions. what would they be for in your case ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;btw. you can make an attr for your index. that way you can use a slider to choose the wall index interactively.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* * *&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've taken some time to code your thing very simply :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;check the code very precisely and try to find out what it does.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- check out the case blocks and what is tested after each other.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- check how door placement variation is done&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- check how I managed the stepping&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let me know if you have more questions !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;@Group ("Building Main") attr buildingHeight = 5 @Group ("Building Main") @Range(1, 20) attr wallID = 3 @Group ("Building Main") attr baseHeight = 0.8&amp;nbsp; Lot --&amp;gt;&amp;nbsp; extrude(world.y, buildingHeight)&amp;nbsp; comp(f) { side =&amp;nbsp; Facades | top : Roof.} # note the # which puts all sides in 1 shape !&amp;nbsp; Facades --&amp;gt;&amp;nbsp; comp(f) {wallID : DoorFacade | all : WallWithWindows}&amp;nbsp; minWallWidth = 0.3 # don't make an attr to keep the variation !&amp;nbsp; @Group ("Doors") attr doorWidth = 1 @Group ("Doors") attr doorHeight = 2.0&amp;nbsp; DoorFacade --&amp;gt;&amp;nbsp; case scope.sx &amp;lt; doorWidth + 2 * minWallWidth : &amp;nbsp; Wall&amp;nbsp; else :&amp;nbsp; 33%: &amp;nbsp; # door centered &amp;nbsp;&amp;nbsp; split(x) { ~1 : WallWithWindows | doorWidth : DoorPart | ~1 :WallWithWindows} &amp;nbsp; 33%: &amp;nbsp; # door left &amp;nbsp;&amp;nbsp; split(x) { minWallWidth : WallWithWindows | doorWidth : DoorPart | ~1 :WallWithWindows} &amp;nbsp; else : &amp;nbsp; # door right &amp;nbsp;&amp;nbsp; split(x) { ~1 : WallWithWindows | doorWidth : DoorPart | minWallWidth&amp;nbsp; :WallWithWindows}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Group ("Windows") attr windowBaseHeight = 0.8 @Group ("Windows") attr windowHeight = 1.2 @Group ("Windows") attr windowWidth = 1.0&amp;nbsp; windowDist = rand(.5,2) # don't make an attr to keep the variation !&amp;nbsp; WallWithWindows --&amp;gt;&amp;nbsp; case scope.sx &amp;lt;= minWallWidth : &amp;nbsp; Wall&amp;nbsp; else : &amp;nbsp; split(y) {windowBaseHeight + baseHeight : Wall | windowHeight : WindowArea | ~1 : Wall}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WindowArea --&amp;gt;&amp;nbsp; split(x) {{~windowDist : Wall | windowWidth : Window}* | ~windowDist : Wall}&amp;nbsp; Window --&amp;gt;&amp;nbsp; color(.3,.3,.4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoorPart --&amp;gt;&amp;nbsp; split(y) {baseHeight : Base | doorHeight : Door | ~1 : Wall}&amp;nbsp; Door --&amp;gt;&amp;nbsp; color(.3,.2,.2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Group ("Steps") attr stepHeight = 0.19 @Group ("Steps") attr stepDepth = 0.27&amp;nbsp; Base --&amp;gt;&amp;nbsp; split(y) {~stepHeight : Step(split.total - split.index)}*&amp;nbsp; Step(index) --&amp;gt;&amp;nbsp; extrude(stepDepth * index)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wall --&amp;gt;&amp;nbsp; color(.8,.7,.7)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 15:31:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124823#M1699</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-08-15T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124824#M1700</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;SPAN&gt;Thanks for that I modified it beautifully to insert it into my model so it works well! I'd been thinking that maybe a recursion could be used to generate steps depending on height but your method works much better! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2012 23:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124824#M1700</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-08-19T23:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124825#M1701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;cool !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;show us some pictures once your done .. or even WIP ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 07:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124825#M1701</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-08-20T07:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124826#M1702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I am getting some beautiful stairs, unfortunately there still seems to be one slight problem as shown in the image, when I am generating a model on a hill, some sides have a base below them and some don't. This results in the sides having different numbers so that when I do a case(myIndex) to get stairs forming on sides with doors, it doesn't count the sides which don't have a base and so my stairs end up on different places to my doors! Do you know a way to fix this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 03:53:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124826#M1702</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-08-22T03:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124827#M1703</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;SPAN&gt;yes, there is a solution to this, though you may need to rewrite a little of the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;as you may know, 'const' values are evaluated only once per shape, then remain so during the model generation process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;const doorSide = 33% : "left" 33%: "right" else : "center"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so in the code which places the split where the DoorTile is created ( with the 3 random placements left, right, middle), you could add the code line above as a new const and then change the code to :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;case doorSide == "left" : split()
..&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;33% : split() left
..&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that way, the const drives the door position. ( you could also make an attr out of it and set it manually. let me know if you wanna know how. that's easy to do.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* * *&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;now the second issue is to synch that the stairs get constructed at the same position as the door. for that, you can use the same splits as for the door and the same case structure which obeys the doorSide const too. That way, you can guarantee that the stairs get created below the doors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not perfectly sure how the indices are defined to set the actual wall for the stairs. would have to look at this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let me know if you need help on this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:08:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/conditional-rules/m-p/124827#M1703</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-11T07:08:01Z</dc:date>
    </item>
  </channel>
</rss>

