CGA Rules, Attributes -unavailable

579
1
10-18-2013 04:36 AM
LukeCzar
New Contributor III
Good morning,


I am working on a simple rule and I would like to use the attributes from the .gdb file, some of them work and some are gray out[ATTACH=CONFIG]28438[/ATTACH]


here is the rule (I am not a programmer)



attr height = 0
attr species = ""
attr diameter = 0


Lot-->
s(diameter/2,height,diameter/2)
i("Tree.obj")



The "species" attr get transferred to the attributes, but "diameter" and "height" don't

I would like to shape the .obj file base on the attributes




Lukasz
Tags (2)
0 Kudos
1 Reply
MatthiasBuehler1
Frequent Contributor
Hi,


possibly, the attrs are of the wrong type. E.g. the string "5" is not the same as the float 5.

try casting the types, this may help.

if the value is actually string in the object attrs, initialize the attr as empty string, then cast the value with float()

e.g.

attr stringValue = "" # connect to object attr.
@Hidden
attr floatValue = 0


Lot -->
    set(floatValue, float(stringValue))
    Continue.



Though this is just a theory. let me know, ok ?

matt
0 Kudos