Create Layer of Attribedutes

2903
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
josedonnelly
New 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 ..



I don't have the Connection Editor button, or at least I can't find it. However, in the Inspector there is the Rule Parameter Bar, below that shows "Zoning_1" coming from my rule I assume. The "Source" was a '?' and now I changed it to "Object" and the "Value" is "Rural" in the appropriate parcels and "Mixed Economic Development" in the appropriate parcels.

I also changed my rule so now it's


attr ZONING_1 = ""

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

Nothing changed, no colors changed.
What did I miss?
0 Kudos
MatthiasBuehler1
Frequent Contributor
ah, I see what the issue is :

you are using 2010.3, the old version which has an other Inspectore. We've changed this in the new version !

first of all, make sure your cga rule file is assigned to the shapes. use the Rule File browse button to assign a rule file to the shapes.

secondly, change the attribute SOURCE from RULE to OBJECT ATTRIBUTE in the Inspector for all shapes.


let me know if this works ! 🙂
0 Kudos
MatthiasBuehler1
Frequent Contributor
oh, and important :

in the color operation, use hex colors, not RGB like this.

eg. red is :
"#ff0000"
( this has also changed for good in the 2011 version. )

btw. in general, I'd recommend you update to the newest version. there's one coming up right now : 2011.2 !

greetings !
0 Kudos
josedonnelly
New Contributor
Thank you Matthias,

The parcel's are still not changing color. I have 2 theories:

1. The rule says to change to #00C957 (emerald green), but what is supposed to change color? The parcel? the boundary of the parcel? I think the rule is missing some direction what to change, but I could be wrong.

Maybe I need to build some height into each parcel and then the color will change?

2. Second idea is there is supposed to be something between the quotes in the attr ZONING_1= "" line, like below. . .

attr ZONING_1 = ""

Lot -->
case ZONING_1 == "rural" :
        color ("#00C957")


I owe you an incredible amount of appreciation. Thank you!
0 Kudos
MatthiasBuehler1
Frequent Contributor
hi !

did you check the log for any input on what may be wrong ?


maybe start off very simple, without any linking of stuff.

does this work :

Lot -->
    extrude(10)
    color(#"ff0000")
0 Kudos
josedonnelly
New Contributor
Thanks again. I tried what you said and all the parcels turned the color I inputed and the height of all increased 10 feet. I am going to try tinkering around with this some more but if you have the next step then I would appreciate it. You suggested something about "string" in one of your earlier posts to help me. Is that part of my problem?
0 Kudos
josedonnelly
New Contributor
Wow, it's all working now. Thank you so much for getting me and my project to this point. The rule file is correctly linked, the parcels have their corresponding colors and I'm starting the next phase which is to build the buildings. I'm looking at others threads and watching the videos, which is helping.

I have added the attribute for stories and the extrude function. There's no errors but when I generate, nothing happens. The color is there but nothing extrudes.

attr ZONING_1 = ""
attr STORIES = ""

Lot -->
case ZONING_1 == "RURAL" :
        color ("#00C957")
        case STORIES == "1" :
        extrude(10)
     case STORIES == "2" :
        extrude(20)
        Shape01.
    case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#00611C")
        case STORIES == "1" :
        extrude(10)
     case STORIES == "2" :
        extrude(20)
     Shape02.


Or should I separate the extrusion from the coloring of the parcels. Like this?:

attr ZONING_1 = ""
attr STORIES = ""

Lot -->

        case STORIES == "1" :
        extrude(10)
     case STORIES == "2" :
        extrude(20)

    case ZONING_1 == "RURAL" :
        color ("#00C957")
        Shape01.
    case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#00611C")
     Shape02.


I have more things to add like setback's, rooves and other things. I am just wondering what the best way to write this script.
0 Kudos
MatthiasBuehler1
Frequent Contributor
hi !

to close 'case' statements, you always need an else at the end to have it work properly.

CGA code can not be executed unless you have no more red error bars on the side of the CGA editor.


coloring and extruding can easily be combined together. that should not be the issue.


let me know if it works ..

matt
0 Kudos
josedonnelly
New Contributor
When I close with "Else" on my case statements for Stories, the next "Case" statement throws an exception. One of the things I saw in other people's code is their Case statements had something to the effect of; Lot--> or anotherword-->

For example:

attr ZONING_1 = ""
attr Stories = ""


Lot-->
     case ZONING_1 = RURAL
     color ("#CCFFF0")
     Shape01.
     else : NIL
LotBuilding-->
     case Stories == "1" : extrude(10)
     case Stories == "2" : extrude(20)
     else : NIL



The lot building seems to separate the else statement and preventing my next case statement from throwing an exception. I hope this makes sense.
0 Kudos
josedonnelly
New Contributor
I tried this below and it worked great but I need to understand why the code I pasted at the bottom didn't work.



attr ZONING_1 = ""

@Startrule

Lot-->
case ZONING_1 == "RURAL" :
        color ("#00C957")
        extrude(20)
        Shape01.
case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :
        color ("#00611C")
        extrude(30)
     Shape02.
case ZONING_1 == "CORE RESIDENTIAL" :
   color ("#C82536")
   extrude(20)
   Shape03.
case ZONING_1 == "RES A" :
   color ("#CD5B45")
   extrude(20)
   Shape04.
case ZONING_1 == "RES B" :
   color ("#C73F17")
   extrude(20)
   Shape05.
case ZONING_1 == "INDUSTRIAL" :
   color ("#C77826")
   extrude(40)
   Shape06.
case ZONING_1 == "RURAL LIGHT INDUSTRIAL" :
   color ("#C8F526")
   extrude(30)
   Shape07.
case ZONING_1 == "PDD" :
   color ("#CAFF70")
   extrude(20)
   Shape08.
case ZONING_1 == "RURAL HAMLET" :
   color ("#CC4E5C")
   extrude(20)
   Shape09.
case ZONING_1 == "RESIDENTIAL LARGE LOT" :
   color ("#CC1100")
   extrude(20)
   Shape10.
case ZONING_1 == "HAMLET" :
   color ("#C67171")
   extrude(20)
   Shape11.
case ZONING_1 == "COMMERCIAL HAMLET" :
   color ("#CC00FF")
   extrude(30)
   Shape12.
case ZONING_1 == "RIVERFRONT RURAL" :
   color ("#00FFAA")
   extrude(30)
   Shape13.
case ZONING_1 == "COMMERCIAL" :
   color ("#008B45")
   extrude(40)
   Shape14.
case ZONING_1 == "RES C" :
   color ("#C82536")
   extrude(20)
   Shape15.
case ZONING_1 == "MULTI-FAMILY" :
   color ("#C71585")
   extrude(40)
   Shape16.
else : NIL
     Shape17.


This below is the code I'm trying to make work.
I want to eventually add other cases and classes.


attr ZONING_1 = ""
attr Stories = "Building Height"
@Startrule

Lot-->
case ZONING_1 == "RURAL" :
        color ("#00C957")
        case Stories == "1" : extrude(10) :     (Throws exception)
        case Stories == "2" : extrude(20) :     (Throws exception)
        case Stories == "3" : extrude(30) :     (Throws exception)
        else : NIL
        Shape01.
case ZONING_1 == "MIXED ECONOMIC DEVELOPMENT" :     (Throws exception)
        color ("#00611C")
        extrude(30)
     Shape02.
case ZONING_1 == "CORE RESIDENTIAL" :
   color ("#C82536")
   extrude(20)
   Shape03.
case ZONING_1 == "RES A" :
   color ("#CD5B45")
   extrude(20)
   Shape04.
case ZONING_1 == "RES B" :
   color ("#C73F17")
   extrude(20)
   Shape05.
case ZONING_1 == "INDUSTRIAL" :
   color ("#C77826")
   extrude(40)
   Shape06.
case ZONING_1 == "RURAL LIGHT INDUSTRIAL" :
   color ("#C8F526")
   extrude(30)
   Shape07.
case ZONING_1 == "PDD" :
   color ("#CAFF70")
   extrude(20)
   Shape08.
case ZONING_1 == "RURAL HAMLET" :
   color ("#CC4E5C")
   extrude(20)
   Shape09.
case ZONING_1 == "RESIDENTIAL LARGE LOT" :
   color ("#CC1100")
   extrude(20)
   Shape10.
case ZONING_1 == "HAMLET" :
   color ("#C67171")
   extrude(20)
   Shape11.
case ZONING_1 == "COMMERCIAL HAMLET" :
   color ("#CC00FF")
   extrude(30)
   Shape12.
case ZONING_1 == "RIVERFRONT RURAL" :
   color ("#00FFAA")
   extrude(30)
   Shape13.
case ZONING_1 == "COMMERCIAL" :
   color ("#008B45")
   extrude(40)
   Shape14.
case ZONING_1 == "RES C" :
   color ("#C82536")
   extrude(20)
   Shape15.
case ZONING_1 == "MULTI-FAMILY" :
   color ("#C71585")
   extrude(40)
   Shape16.
else : NIL
     Shape17.
0 Kudos