Rotating depending on split index

549
1
02-24-2013 11:02 AM
Kevin_J_Zhang
New Contributor
Hi,

I have a simple script that splits a large parcel into smaller subparcels. However, I want the middle rows be rotated, for every OTHER row. I have an inkling of how to do with this split.index being odd or even and rotateScope, but not sure how to do it. Any help would be much appreciated.
Lot -->
 split(x)
  {
   SubDepth:rotateScope (0,-90,0)split(x){~SubWidth:SubparcelShowFront}*|
   ~1:split(z)
    {
    ~SubDepth:split(x)
     {
     ~SubWidth:
     SubparcelShowFront
     }*
    }*|
   SubDepth:rotateScope (0,90,0)split(x){~SubWidth:SubparcelShowFront}*
   }

SubparcelShowFront-->
 setback(2){front:yardfront|remainder:rest}

yardfront-->color(1,0,0)
rest-->color(0,1,0)
[ATTACH=CONFIG]22127[/ATTACH]
0 Kudos
1 Reply
AndreasHeldt
New Contributor II
If you want to change the scope rotation depending on a value, I'd suggest using a function which will give you a rotation depending on the split index:


ScopeRotation(splitIndex) =
 case splitIndex % 2 == 0:
   90
 else:
   0

// ...

rotateScope(0, ScopeRotation(split.index), 0)


Regards,
Oliver
0 Kudos