AnsweredAssumed Answered

Conditional rule + reporting

Question asked by dochan on Mar 25, 2014
Latest reply on Mar 30, 2014 by dochan
Hi, I am new to this forum. I have been working on my project in urban design/planning using City Engine. I have a problem writing CGA rules, specifically writing conditional rule consisting reporting.

Here's the code I wrote (this is just basics, the whole codes is too lengthy to show here. But this shows the essential part)  :

@Range("A","B","C","D","E") attr groundfloorUse = "A"  @Range("A","B","C","D","E") attr upperfloorUse = "A"  reporting -->      case groundfloorUse == "A" : report("F", 1)     case groundfloorUse == "B" : report("G", 2)     case groundfloorUse == "C" : report("H", 3)     case groundfloorUse == "D" : report("I", 4)     case groundfloorUse == "E" : report("J", 5)     else: reporting2  reporting2 --> case upperfloorUse == "A" : report("A", 1)     case upperfloorUse == "B" : report("B", 2)     case upperfloorUse == "C" : report("C", 3)     case upperfloorUse == "D" : report("D", 4)     case upperfloorUse == "E" : report("E", 5)     else: NIL


Now, the frustation begins.. When I apply that code to a lot, it shows 2 parameters as I wrote on CGA rules (just the way I wanted), but when I apply two different attributes to a lot, it only shows result just from one of them. For example; if I apply a lot's groundfloorUse = "A" and upperfloorUse = "B", the reporting window only shows the result regarding to just one of the attributes instead of showing the result from 2 different attributes.

I have been trying many things, writing the whole code in one function, separate it into two functions (just like I showed), using ||, and &&. But it didn't work well.

Can somebody help me? Any answers is much appreciated.

Pardon my English
Thanks

Outcomes