Create Layer of Attribedutes

2851
23
02-04-2012 11:28 AM
josedonnelly
New Contributor
I'm a newbie stuck with a very newbie problem. I imported a shape file from Arc and was successful in keeping all attributes to the features. However the file lists all 16k and I need to organize them by an attribute (in this case which zoning district they're in) As I stated the all have kept their 'zoning' number, now I just need to organize them by each of those zones, so all the "01" of the 'zoning' attribute are kept together. I think I have to create essentially subfiles, so I should make my scene window looks like

-Scene Light
-Panorama
-All Parcels (16,028)
    

  • Zoning 1

  • Zoning 2

  • Zoning 3

  • etc

  • etc


I'm racking my brain if this is right or if the other dozen methods using scripting and rules is the proper way. How do I create these subfiles? How do I select from my dozen attributes the attribute called "zoning" and then select them into "01" and "02" etc. I'm using Pro 2010.3 if it matters. After that I would like to select "stories" (aka height) and multiple it by 10 (10 feet per story)Thanks for any help that can be provided.
Tags (2)
0 Kudos
23 Replies
MatthiasBuehler1
Frequent Contributor
hi !

CityEngine handles data a little different than ArcGIS. e.g. there's no spreadsheet available which lets you sort all data.


--> you can 1 ] select shapes based on attributes
--> you can use CGA rules to distinguish the attributes for each footprint for the building generation.





for 1], start with the following docs :

selecting via attribute values : boolean expression in attribute layer
- check Manual > Map Layers > Selection via Image Maps
- check Manual > Mapping Attributes > Mapping Object Attributes via Layer Attribute

if you have questions here, let me know .. ok ?




for 2], create and assign a cga rule file to all shapes.

within the rule file, define an attr :
attr zoning = ""       # this is a string definition


assign the rule file to all shapes and use the connection editor to point the attribute to the imported Object Attribute (GIS data), not the rule value.

from there, you can use "case.. else" statements to distinguish all sorts of things.

example :
attr zoning = ""

Lot -->
    case zoning == "01" :
        color(1,0,0)
        Shape01.
    case zoning == "02" :
        color(0,1,0)
        Shape02.
    else :
        color(0,0,1)
        Shape03.
0 Kudos
josedonnelly
New Contributor
Wow! Thank you! This was a huge help, I had some code right and some wrong. I'll let you know if I have any more trouble! Thank you!
0 Kudos
josedonnelly
New Contributor
Here is my code

attr zoning =
    case zoning == "01" :
        color (#f26522)
    case zoning == "02" :
        color (#f30034)
     else :

The else is throwing an exception, what am I missing? Thanks for your help.
0 Kudos
josedonnelly
New Contributor
Here is my code

attr zoning =
    case zoning == "01" :
        color (#f26522)
    case zoning == "02" :
        color (#f30034)
     else :

The else is throwing an exception, what am I missing? Thanks for your help.



hahaha, Nevermind I figured it out. Total learning experience.

This is my code now
attr zoning = ""

Lot -->
    case zoning == "01" :
        color ("#f26522")
    case zoning == "02" :
        color ("#f30034")
     else : NIL
     

I think my color codes are wrong because none of the parcels changed color, I'm not sure where or why I picked up a hexcolor code.
Now if I want to go ahead and create the buildings for each parcel I can just do it like this:

attr zoning = ""

Lot -->
    case zoning == "01" :
        color ("#f26522")
    Extrude =
    Etc
    Etc
    case zoning == "02" :
        color ("#f30034")
    Etc
    Etc
     else : NIL
   
     Is this correct? I can just write the rules for each attribute under each case: attribute  ???
0 Kudos
josedonnelly
New Contributor
I changed to another attribute to better clarify what that zoning is rather than just using a number as before, I had 3 zoning descriptors. I think I'm all good there but my parcels are not changing color. When I look at the actual parcels that should be affected they ahve the rule applied to them, but the "Value" is blank, i can type in it. Does the color only change if I extrude?

attr ZONING_1 = ""

Lot -->
    case ZONING_1 == "RURAL" :
        color ("#ff3300")
    case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#CC0033")
     else : NIL
0 Kudos
josedonnelly
New Contributor
I changed to another attribute to better clarify what that zoning is rather than just using a number as before, I had 3 zoning descriptors. I think I'm all good there but my parcels are not changing color. When I look at the actual parcels that should be affected they ahve the rule applied to them, but the "Value" is blank, i can type in it. Does the color only change if I extrude?

attr ZONING_1 = ""

Lot -->
    case ZONING_1 == "RURAL" :
        color ("#ff3300")
    case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#CC0033")
     else : NIL
0 Kudos
josedonnelly
New Contributor
attr ZONING_1 = "01"

Lot -->
case ZONING_1 == "RURAL" :
        color ("#56,193,55")
        Shape01.
    case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#205,235,241")
        Shape02.
    else : NIL
     Shape03.
   

This is my code right now, no errors so that's good. Problem is, nothing is changing colors, I tried extrusions and nothing came up. So there must be something wrong with mmy " ZONING_1 " reference. IDK if anyone can help here. My rule paremeters shows ZONING_1 so it be referrring to the rule, but there's no "value" listed, it's just an empty box to type in. I'm confused.

Thanks to anyone that can help.
0 Kudos
MatthiasBuehler1
Frequent Contributor
hi Jose,


is your attribute actually pointing to the right source ?

does it say in the Inspector :
ZONING_1     "" (Rule) ?

if this is the case, you have to point the value to the object attr instead of using the rule value.
use the connection editor button in the Inspector (white rectangle with black triangle) and connect to the object attr.


let me know ..
0 Kudos
josedonnelly
New Contributor
I am not seeing the triangle-rectangle shape. I have looked all over. [ATTACH=CONFIG]11977[/ATTACH]
0 Kudos