Color by Land Use

2621
2
Jump to solution
10-28-2014 08:38 AM
Luiz_AmadeuCoutinho
Occasional Contributor III

Hi Guys

I´m newbie in CGA.

I tried apply Color in (2D) Shapes based on Land Use atribute. I use 3DCIM_Parcel_Zoning Envelopes.cga as a sample, but this CGA change my geometry (Angles)

I need a simple CGA sample for apply a Color based on attribute, without geometry operations, just change colors.

POS_CGA.JPG

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

This is a simple rule example. One attribute determines color. That color is shown in the other attribute, YourColor, and that color attribute can be overridden by the color picker on that attribute.

Chris

version "2014.1"

@Range("Go", "Caution", "Stop")

attr DeterminesColor = "Go"

@Color

attr YourColor = theFunctionThatGivesColorPerAttribute

@StartRule

ColorMeMine -->

  color(theFunctionThatGivesColorPerAttribute)

theFunctionThatGivesColorPerAttribute =

  case DeterminesColor == "Go": "#00FF00" #Green

  case DeterminesColor == "Caution": "#FFAA00" #Orange

  case DeterminesColor == "Stop": "#FF0000" # Red

  else: "#000000" #Error! Picker value unknown. Use black.

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable

This is a simple rule example. One attribute determines color. That color is shown in the other attribute, YourColor, and that color attribute can be overridden by the color picker on that attribute.

Chris

version "2014.1"

@Range("Go", "Caution", "Stop")

attr DeterminesColor = "Go"

@Color

attr YourColor = theFunctionThatGivesColorPerAttribute

@StartRule

ColorMeMine -->

  color(theFunctionThatGivesColorPerAttribute)

theFunctionThatGivesColorPerAttribute =

  case DeterminesColor == "Go": "#00FF00" #Green

  case DeterminesColor == "Caution": "#FFAA00" #Orange

  case DeterminesColor == "Stop": "#FF0000" # Red

  else: "#000000" #Error! Picker value unknown. Use black.

0 Kudos
Luiz_AmadeuCoutinho
Occasional Contributor III

Thank you so much Mr Chris

Work´s fine :)

0 Kudos