Testing Waters
  • Scrapbook
  • Projects
    • Bamiyan Cultural Center
    • Bauhaus Museum
    • Better Hebbal
    • Bicycle Station
    • Cross Laminated Timber
    • Facade
    • Flowing Fabrication
    • Form from Images
    • Guggenheim Helsinki
    • National War Museum
    • National War Memorial
    • Indflorescence
    • Rectangular Compartments
    • Retail Space Layout
    • Noise Barrier : Swedevia Airport
    • Walden
    • Wilson Garden
  • Patterns
    • Area Graph
    • Array along Curve
    • Fibbonacci and Factorial
    • Gyroid
    • Hexagonal Pattern From Image
    • Hexagonal Grid
    • Koch Star
    • Mandelbrot Set
    • Pattern
    • Pattern
    • Pattern
    • Phyllotaxis
    • Random Strip Widths
    • Skewed Surface
    • Staggered Checkerboard
    • Triangle subdivision
    • Vector Field
    • Voronoi
    • Waves
    • Weave
  • Geometry
    • Boundary Curve
    • Bridging parallel curves
    • British Museum Great Court
    • Catenary
    • Delete Adjacent
    • Geodesic Sphere
    • Group Branching Curves
    • Group Circles
    • Group curves
    • K Mean
    • Nurbs Surface Irregular
    • Overlapping Petals
    • Pair Nearest
    • Parametric Shapes
    • Platonic Solids
    • Polyline to PolyArc
    • Roman Surface
    • Sagrada Familia Schools Roof
    • Sine Curve
    • Sine Ribbon
    • Spherical Transformations
    • Split Rectangle
    • Tangential Circle through Point
    • Travelling Salesman Problem
    • Unaligned Bounding Box
  • Lists
    • Alter by Boolean Sequence
    • Color by distance
    • Consecutive Points
    • Distancing
    • Divide Equally
    • Geometry from Image
    • Image based Point Density
    • Isovists
    • Reduce Color Palette
    • Replace Consecutive
    • Replace Multiple
    • Replace Recurring
    • Shadow Area
    • Shortest Path
    • Solar Analysis
    • Topography Analysis
  • Motion
    • Adjacency
    • Animate Sphere
    • Cellular Automation
    • Cloth
    • Hypotrochoid
    • Manakin
    • Rolling Spiral
    • Tan Curve
    • Trammel of Archemedes
    • Image to Integer
  • Articles
    • A Conceptual Approach to Integrating Computational Methods in Early Stage Design
    • Design Script's ambiguous and versatile Replication Guides <1>
    • Design Script's ambiguous and versatile Replication Guides <2>
Powered by GitBook
On this page
  1. Lists

Color by distance

PreviousAlter by Boolean SequenceNextConsecutive Points

Last updated 4 years ago

l1=(Line.ByStartPointEndPoint((elm.BoundingBox).MaxPoint,
(elm.BoundingBox).MinPoint)).PointAtParameter(0.5);
crnBb=BoundingBox.ByGeometry(crn.Geometry());
crnCp=(Line.ByStartPointEndPoint(crnBb.MaxPoint,
crnBb.MinPoint)).PointAtParameter(0.5);
l2=Line.ByStartPointEndPoint(Point.ByCoordinates
(crnCp.X,crnCp.Y,crnBb.MinPoint.Z),Point.ByCoordinates
(crnCp.X,crnCp.Y,crnBb.MaxPoint.Z));

//max and min distances of each distance group
d1=Flatten(l1<1>.DistanceTo(l2));
d2=List.MinimumItem(d1)..List.MaximumItem(d1)..~inc;

i1=List.DropItems(d2,-1);
i2=List.DropItems(d2,1);

//Filteration criteria
b1=List.Flatten(d1>i1<1><2>,1);
b2=List.Flatten(d1<=(i2+100)<1><2>,1);
b1&&b2;

//Sorting elements into groups
g1=List.FilterByBoolMask(elm,(b1&&b2)<1>);
g2=List.GetItemAtIndex(g1<1>,0);

//Colors
c=List.TakeItems(Transpose(col)[1],List.Count(d2)-1);

//Override color in Revit view
g=g2<1><2>.OverrideColorInView(c<1>);

//Legend
lg1=Math.Round(i1,1);
lg2=Math.Round(i2,1);
lg3=List.TakeItems(Transpose(col)[0],List.Count(d2)-1);
lg=[lg1,lg2,lg3];

lg1+" to "+lg2+" ["+lg3+"]";
[["Red",Color.ByARGB(255,255,0,0)],
["Green",Color.ByARGB(255,0,255,0)],
["Blue",Color.ByARGB(255,0,0,255)],
["Yellow",Color.ByARGB(255,255,255,0)],
["Cyan",Color.ByARGB(255,0,255,255)],
["Magenta",Color.ByARGB(255,255,0,255)],
["Violet",Color.ByARGB(255,238,130,238)],
["Orange",Color.ByARGB(255,255,165,0)],
["Brown",Color.ByARGB(255,165,42,42)],
["Gray",Color.ByARGB(255,128,128,128)]];
2KB
crane1.zip
archive
3KB
crane.zip
archive