Applying styles from within the rule

2063
3
05-26-2014 01:26 AM
AleksandarLalovic
New Contributor II
Is it possible to apply the styles from within the rule file itself.

Lets say i have a multiple facade styles and i would like to:

1. Randomize them, take a random facade style
2. Choose a specific style based on some other parameters (eg. certain building envelopes are appropriate for certain facade styles)
Tags (2)
0 Kudos
3 Replies
MatthiasBuehler1
Frequent Contributor
Hi,


I wished for this also before. But the way you imagine it to work sadly does not work.

You can call styles, but then, you need to have that CGA code within the style definition, which is very clumsy and unintuitive. I gave it up.


m.
0 Kudos
AleksandarLalovic
New Contributor II
I have and issue that let say my rule is a set of many parameters defining a building which are not all necessarely competable with each other (some times you get weired combinations which are not realy convincing). Styles on the other hand are a predefined configurations that work. And once a generate lets say a block of several buildings i would like each building to have one of the predefined facade styles istead of each of them having a variation of a default style. 

Would it be possible at least that once I generate a new model i start with one of the styles from the library (choose a random one out of the existing ones) instead of starting with a default style always?
0 Kudos
MatthiasBuehler1
Frequent Contributor
Not really ..


there's only this, but I don't suppose this makes you happy, because you need to copy the code.

Shape -->
 A2$Continue // note the $

style A1
attr height  = 5
attr col   = 0
Continue -->
 extrude(height)
 color(col, col, col)


style A2
attr height  = 50
attr col   = .5
Continue -->
 extrude(height)
 color(col, col, col)



Matt
0 Kudos