Cannot connect to object attribute streetWidth()

2499
8
12-16-2012 08:18 PM
MatthewChan1
New Contributor
Hi Guys

just trying to connect to the object attribute of a dynamic shape in cga

attr shapeType = ""
attr streetWidth() = 0


I can connect to shapeType but not streetWidth/streetWidth(0) automatically generated object attribute. see screen cap attached.

any ideas?

Cheers,

MC
0 Kudos
8 Replies
JoanneO_Brien
Occasional Contributor
I think that might be because you don't have a specific streetWidth() value. Have you tried using either streetWidth(*) or streetWidth(0)?

hope it helps
0 Kudos
MatthewChan1
New Contributor
I think that might be because you don't have a specific streetWidth() value. Have you tried using either streetWidth(*) or streetWidth(0)?

hope it helps


Thanks for the reply, I get error messages (token mismatch) with both "streetWidth(*)" and "streetWidth(0)"
I have looked through the CE documentation, couldn't find anything about this situation...

Cheers,

MC
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi !

Use a parameter, e.g. 'i' for index.

attr streetWidth(i) =  0



that way you can go and grab each edge's entry based on the index.

Note that the first entry is 0 and has the biggest street width value.


ok ?
0 Kudos
MatthewChan1
New Contributor
Hi !

Use a parameter, e.g. 'i' for index.

attr streetWidth(i) =  0



that way you can go and grab each edge's entry based on the index.

Note that the first entry is 0 and has the biggest street width value.


ok ?


Awesome! This worked :) thanks Matt!
0 Kudos
MatthewChan1
New Contributor
Just a follow up question, Is it possible to connect to higher level parameters (Block parameter, Street parameters, intersection parameter etc...) which generates all the lot shapes? Similar idea to the streetWidth object attribute which gets passed on to the shapes after the street gets created.

say for example if I want the building envelope to have a setback (rule parameter) relative to the lotWidthMin (block parameter) value, how would i do that?

It looks like the only object attribute available are streetWidth and shapeType.

Cheers and happy new year!
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi !

These are basically 'just' parameters for the Dynamic Subdivision, so since those are not that important, they're not inherited to the shapes which are created.

But you can map those Subdivision parameters with a map layer (image-based), so you could use the same map layer then for each created shape to sample again the value of interest.

Setting this up takes a little time, but I have some examples for this, if needed.

Cheers !

Matt
0 Kudos
MatthewChan1
New Contributor
Hi !

These are basically 'just' parameters for the Dynamic Subdivision, so since those are not that important, they're not inherited to the shapes which are created.

But you can map those Subdivision parameters with a map layer (image-based), so you could use the same map layer then for each created shape to sample again the value of interest.

Setting this up takes a little time, but I have some examples for this, if needed.

Cheers !

Matt


examples on how this could be done would be great!
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi !

Here's an example which shows how an image is used to map the width of streets via a 'class' attribute of a map layer. This way, you can encode different street types via width.

There's 2 street types which drive the Dynamic City Layout System's parameters. Also, the 'lotAreaMin' and 'lotAreaMax' params are driven via the 'class' Map Layer. Btw. the 'class' Map Layer is of the type 'Mapping'.

This so far is all non-related to CGA other than the 'class' Map Layer's attributes are written in CGA code. But this has nothing to do with the Model Generation using CGA. This is all SHAPE CREATION Process.

Note :
1 Shape + 1 CGA Rule --> 1 Model

* * *

Then, in the CGA rule which creates the buildings, the streetWidth object attributes (which are inherited to each shape from the shape creation process) are sampled and checked concerning width. If the width is equal to the value of the wide street, the building is red.

* * *

Since not all parameters can be inherited down to the shapes as object attributes - as mentioned in my last post - you may want to use sampling for each shape again (maybe even the same mapping layer as the layout uses) to drive other things.

Note especially how the attribute sources are set (in brackets).

Read through this a couple of times and study the screenshots and project attached.
Play with the setup by selecting a street node and dragging it around.

Cheers !

Matt
0 Kudos