Query Object Attributes from CGA

2969
2
11-14-2011 07:23 AM
Jackde_Valpine
New Contributor
Hi,

I am subdividing imported blocks using a python script. I note that the subdivision is automatically generating a potentially handy boolean "Object Attribute" for each resulting lot called "enclosed." However, I do not get how I can access this attribute from a CGA applied to the blocks? I see in the documentation a function called "getObjectAttr," however this function does not seem defined in CGA?

Any direction would be welcome.

Thanks,

-Jack
0 Kudos
2 Replies
MatthiasBuehler1
Frequent Contributor II
hi Jack.

first, you need to initialize the attr in the CGA rule file.

see this code :

attr enclosed = false

Lot -->
 case enclosed == true :
  color("#ff0000")
 else:
  color("#00ff00")


once you have assigned the rule, change the Attribute Source to 'Object attribute'.

In the 2011 version, this is done with the little black triangle on white rectangle next to the attr entry in the Inspector.

Ok ?
0 Kudos
Jackde_Valpine
New Contributor
Hi Matthias,

Thanks for the follow-up, I had just managed to finally get this figured out with some more exploration!

Thanks,

-Jack

hi Jack.

first, you need to initialize the attr in the CGA rule file.

see this code :

attr enclosed = false

Lot -->
 case enclosed == true :
  color("#ff0000")
 else:
  color("#00ff00")


once you have assigned the rule, change the Attribute Source to 'Object attribute'.

In the 2011 version, this is done with the little black triangle on white rectangle next to the attr entry in the Inspector.

Ok ?
0 Kudos