Hi,
There is probably a very simple answer to this question but I'm having a difficult time figuring out how to set it up. I would like to be able to set attribute values for multiple buildings at once using a CGA rule file, rather than manually selecting every relevant model and changing values in the Inspector window.
As two very basic starter examples I was trying, I am looking at three attributes: height, area, and score/volume. I already have the height and area values associated with each building, and I would like to create a rule file/rule files that (1) assign certain values (score) to certain buildings, and (2) assign mathetmatically calculated values (volume) to buildings. The score and volume fields were created but are currently empty (i.e. value zero).
Starting with Score, I tried to very simply set up a rule file that would assign a value of 1 to buildings with a greater height than area, a score of 2 to buildings with equal height and area, and a value of 3 to buildings with a greater area than height. I tried using the script below but the score values remained at zero.
attr height = 0
attr area = 0
attr score = 0
Lot --> extrude(height) Mass
Mass -->
case height > area :
set(score, 1)
case height == area :
set(score, 2)
else :
set(score, 3)
I also tried the variation below, which also did not work.
attr height = 0
attr area = 0
attr score = 0
Lot --> extrude(height) Mass
Mass -->
case height > area :
score = 1
case height == area :
score = 2
else :
score = 3
I'm sure it is a simple fix but I'm not sure which grammar to use. I also wanted to do one that sets the attribute value for volume by calculating (height x area), but I don't think I would be able to get that one to work if I can't get this one to work. Any help would be much appreciated!
Thank you,
km