Color by distance
crane.zip
3KB
Binary
1
l1=(Line.ByStartPointEndPoint((elm.BoundingBox).MaxPoint,
2
(elm.BoundingBox).MinPoint)).PointAtParameter(0.5);
3
crnBb=BoundingBox.ByGeometry(crn.Geometry());
4
crnCp=(Line.ByStartPointEndPoint(crnBb.MaxPoint,
5
crnBb.MinPoint)).PointAtParameter(0.5);
6
l2=Line.ByStartPointEndPoint(Point.ByCoordinates
7
(crnCp.X,crnCp.Y,crnBb.MinPoint.Z),Point.ByCoordinates
8
(crnCp.X,crnCp.Y,crnBb.MaxPoint.Z));
9
10
//max and min distances of each distance group
11
d1=Flatten(l1<1>.DistanceTo(l2));
12
d2=List.MinimumItem(d1)..List.MaximumItem(d1)..~inc;
13
14
i1=List.DropItems(d2,-1);
15
i2=List.DropItems(d2,1);
16
17
//Filteration criteria
18
b1=List.Flatten(d1>i1<1><2>,1);
19
b2=List.Flatten(d1<=(i2+100)<1><2>,1);
20
b1&&b2;
21
22
//Sorting elements into groups
23
g1=List.FilterByBoolMask(elm,(b1&&b2)<1>);
24
g2=List.GetItemAtIndex(g1<1>,0);
25
26
//Colors
27
c=List.TakeItems(Transpose(col)[1],List.Count(d2)-1);
28
29
//Override color in Revit view
30
g=g2<1><2>.OverrideColorInView(c<1>);
31
32
//Legend
33
lg1=Math.Round(i1,1);
34
lg2=Math.Round(i2,1);
35
lg3=List.TakeItems(Transpose(col)[0],List.Count(d2)-1);
36
lg=[lg1,lg2,lg3];
37
38
lg1+" to "+lg2+" ["+lg3+"]";
Copied!
1
[["Red",Color.ByARGB(255,255,0,0)],
2
["Green",Color.ByARGB(255,0,255,0)],
3
["Blue",Color.ByARGB(255,0,0,255)],
4
["Yellow",Color.ByARGB(255,255,255,0)],
5
["Cyan",Color.ByARGB(255,0,255,255)],
6
["Magenta",Color.ByARGB(255,255,0,255)],
7
["Violet",Color.ByARGB(255,238,130,238)],
8
["Orange",Color.ByARGB(255,255,165,0)],
9
["Brown",Color.ByARGB(255,165,42,42)],
10
["Gray",Color.ByARGB(255,128,128,128)]];
Copied!
crane1.zip
2KB
Binary
Copy link