Skip to content

Commit 3618374

Browse files
committed
feat(VisualizationController): add support for Outline geometry in bounding box visualization
1 parent f495d23 commit 3618374

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

source/RevitDevTool/VisualizationController.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ public static void Add<T> (T geometry)
4848
case BoundingBoxXYZ boundingBox:
4949
BoundingBoxVisualizationServer.AddGeometry(boundingBox);
5050
break;
51+
case Outline outline:
52+
var bbox = new BoundingBoxXYZ
53+
{
54+
Min = outline.MinimumPoint,
55+
Max = outline.MaximumPoint
56+
};
57+
BoundingBoxVisualizationServer.AddGeometry(bbox);
58+
break;
5159
case Mesh mesh:
5260
MeshVisualizationServer.AddGeometry(mesh);
5361
break;
@@ -80,6 +88,7 @@ public static void Add<T> (IEnumerable<T> geometries)
8088
return geometry switch
8189
{
8290
BoundingBoxXYZ => typeof(BoundingBoxXYZ),
91+
Outline => typeof(Outline),
8392
Mesh => typeof(Mesh),
8493
Solid => typeof(Solid),
8594
XYZ => typeof(XYZ),
@@ -101,6 +110,13 @@ public static void Add<T> (IEnumerable<T> geometries)
101110
case not null when geometryType == typeof(BoundingBoxXYZ):
102111
BoundingBoxVisualizationServer.AddGeometries(group.Cast<BoundingBoxXYZ>());
103112
break;
113+
case not null when geometryType == typeof(Outline):
114+
BoundingBoxVisualizationServer.AddGeometries(group.Cast<Outline>().Select(outline =>
115+
new BoundingBoxXYZ {
116+
Min = outline.MinimumPoint,
117+
Max = outline.MaximumPoint
118+
}));
119+
break;
104120
case not null when geometryType == typeof(Mesh):
105121
MeshVisualizationServer.AddGeometries(group.Cast<Mesh>());
106122
break;

0 commit comments

Comments
 (0)