case issue

936
5
08-20-2013 06:32 AM
JohnathanMann1
New Contributor II
Hello All  I am trying to build a floor plan  from a single shape file that I attributed in Arc. My problem comes about when applying the case statement to the attribute fields. Code below: If I just start off with Glass everything works fine. however when I add wall I get no Errors but the wall does not Extrude. Vise-Versa If i comment out the glass and hit generate the Wall extrudes like I expected. How come when i try to do both nothing happens?

attr WallTypes      = "unknown"
attr FloorTypes  = "unknown"
attr WindowType  = "unknown"
attr DeskType   = "unknown"
attr Floor      = 0
attr Height   = 0
attr Glass_Visibility = 0.5


@StartRule

Glass-->
case WindowType == "Glass" :
  extrude(Height)
  set(material.opacity,Glass_Visibility)
  alignScopeToAxes(y)
  t(0,Floor,0)
  else:
   NIL

Walls-->
case WallTypes == "ExteriorWall":
   extrude(Height)
  alignScopeToAxes(y)
  t(0,Floor,0)
else:
  NIL
0 Kudos
5 Replies
MatthiasBuehler1
Frequent Contributor
hi,

can you try making no empty line between @StartRule and Glass ?

let me know.

m.
0 Kudos
JohnathanMann1
New Contributor II
hi,

can you try making no empty line between @StartRule and Glass ?

let me know.

m.


Unfortunately that does not solve the issue.
0 Kudos
MatthiasBuehler1
Frequent Contributor
And you're sure the Start Rule entries in the Inspector are set correctly ?

And sure that the attr sources are set to 'object attr' ?

m.
0 Kudos
JohnathanMann1
New Contributor II
Yes I have double checked the Assigned Attributes, like i said If I comment out either one they work....It just does not like to work when both rule statements are there. I instead just threw everything in one  rule statement for the sake of my sanity. I do have one question that is still not clear to me, since i have a everything in one rule how can I make a rule to turn a floor off and on?


attr WallTypes      = "unknown"
attr FloorTypes  = "unknown"
attr WindowType  = "unknown"
attr DeskType   = "unknown"
attr Floor      = 0
attr Height   = 0
attr Glass_Visibility = 0.5

@StartRule
Glass-->
case WindowType == "Glass" :
  extrude(Height)
  set(material.opacity,Glass_Visibility)
  alignScopeToAxes(y)
  t(0,Floor,0)
case WallTypes == "ExteriorWall":
    extrude(Height)
    setupProjection(1,scope.xy,'6,'1)
   projectUV(0)
   texture("stone/0333_stone_redbrick.jpg")
   alignScopeToAxes(y)
   t(0,Floor,0)
Ect.......
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi !

Your code works correctly. I tested it with Height = 1.

So I assume the issue may be that the attr source is wrongly set. Make sure the attr in the Inspector points to the Object Attr, not the default rule value..

Let me know if this fixes the issue.

As said, the code is correct..

Matt
0 Kudos