Skip to content

Visualization GeometryTypes

Truong Giang Vu edited this page Feb 14, 2026 · 2 revisions

Supported Geometry Types

Quick reference for geometry types supported by the visualization system.


Overview

RevitDevTool can visualize all standard Revit geometry types directly in 3D views. Simply print the geometry object (Python) or use TraceGeometry.Show() (C#).

See complete examples:


1. Curves

Supported Types:

  • Line - Straight line segments
  • Arc - Circular arcs
  • Ellipse - Elliptical arcs
  • NurbSpline - NURBS splines
  • HermiteSpline - Hermite splines
  • CurveLoop - Closed curve loops
  • PolyLine - Multi-segment polylines
  • Edge - Curve from element edge

Python Example:

from Autodesk.Revit.DB import Line, Arc, XYZ

# Line
line = Line.CreateBound(XYZ(0, 0, 0), XYZ(10, 0, 0))
print(line)

# Arc  
arc = Arc.Create(XYZ(0, 0, 0), 5, 0, 3.14, XYZ.BasisX, XYZ.BasisY)
print(arc)

C# Example:

using Autodesk.Revit.DB;
using RevitDevTool.Visualization;

var line = Line.CreateBound(XYZ.Zero, new XYZ(10, 0, 0));
TraceGeometry.Show(line);

var arc = Arc.Create(XYZ.Zero, 5, 0, Math.PI, XYZ.BasisX, XYZ.BasisY);
TraceGeometry.Show(arc);

See: CurveVisualization.cs, visualization_curve_script.py


2. Faces

Supported Types:

  • PlanarFace - Flat surfaces
  • CylindricalFace - Cylindrical surfaces
  • ConicalFace - Conical surfaces
  • RevolvedFace - Revolved surfaces
  • RuledFace - Ruled surfaces
  • HermiteFace - Hermite surfaces

Python Example:

# Get face from element
options = Options()
geometry = element.get_Geometry(options)

for geo_obj in geometry:
    if isinstance(geo_obj, Solid):
        for face in geo_obj.Faces:
            print(face)  # Visualize each face

C# Example:

var options = new Options();
var geometry = element.get_Geometry(options);

foreach (var geoObj in geometry)
{
    if (geoObj is Solid solid)
    {
        foreach (Face face in solid.Faces)
        {
            TraceGeometry.Show(face);
        }
    }
}

See: FaceVisualization.cs


3. Solids

Description:

  • 3D solid geometry with volume
  • Displays all faces and edges automatically
  • Handles complex geometry

Python Example:

# Get solid from element
options = Options()
geometry = element.get_Geometry(options)

for geo_obj in geometry:
    if isinstance(geo_obj, Solid) and geo_obj.Volume > 0:
        print(geo_obj)  # Visualize entire solid

C# Example:

var options = new Options();
var geometry = element.get_Geometry(options);

foreach (var geoObj in geometry)
{
    if (geoObj is Solid solid && solid.Volume > 0)
    {
        TraceGeometry.Show(solid);
    }
}

See: SolidVisualization.cs, visualization_solid_script.py


4. Meshes

Description:

  • Triangulated mesh geometry
  • Pre-tessellated surfaces
  • Supports vertex colors

Python Example:

# Get mesh from element
options = Options()
geometry = element.get_Geometry(options)

for geo_obj in geometry:
    if isinstance(geo_obj, Mesh):
        print(geo_obj)

C# Example:

var options = new Options();
var geometry = element.get_Geometry(options);

foreach (var geoObj in geometry)
{
    if (geoObj is Mesh mesh)
    {
        TraceGeometry.Show(mesh);
    }
}

See: MeshVisualization.cs


5. Points (XYZ)

Description:

  • Individual 3D points
  • Displayed with colored axes (X=Red, Y=Green, Z=Blue)
  • Optional plane visualization

Python Example:

from Autodesk.Revit.DB import XYZ

# Single point
point = XYZ(10, 20, 5)
print(point)

# Multiple points
points = [XYZ(0, 0, 0), XYZ(10, 0, 0), XYZ(10, 10, 0)]
for pt in points:
    print(pt)

C# Example:

using Autodesk.Revit.DB;
using RevitDevTool.Visualization;

// Single point
var point = new XYZ(10, 20, 5);
TraceGeometry.Show(point);

// Multiple points
var points = new List<XYZ> 
{ 
    XYZ.Zero, 
    new XYZ(10, 0, 0), 
    new XYZ(10, 10, 0) 
};

foreach (var pt in points)
{
    TraceGeometry.Show(pt);
}

See: XYZVisualization.cs, visualization_xyz_script.py


6. Bounding Boxes

Description:

  • Element bounding boxes
  • Wireframe and surface display
  • Quick spatial preview

Python Example:

# Get bounding box from element
bbox = element.get_BoundingBox(None)
if bbox:
    print(bbox)

# Multiple elements
elements = FilteredElementCollector(doc).OfClass(Wall).ToElements()
for elem in elements:
    bbox = elem.get_BoundingBox(None)
    if bbox:
        print(bbox)

C# Example:

// Get bounding box from element
var bbox = element.get_BoundingBox(null);
if (bbox != null)
{
    TraceGeometry.Show(bbox);
}

// Multiple elements
var elements = new FilteredElementCollector(doc)
    .OfClass(typeof(Wall))
    .ToElements();

foreach (var elem in elements)
{
    var box = elem.get_BoundingBox(null);
    if (box != null)
    {
        TraceGeometry.Show(box);
    }
}

Collections

Description: All geometry types can be visualized in collections:

Python:

# Mixed geometry types
geometries = [line1, face1, solid1, point1]
for geom in geometries:
    print(geom)

C#:

// Mixed geometry types
var geometries = new List<GeometryObject> { line1, face1, solid1 };
foreach (var geom in geometries)
{
    TraceGeometry.Show(geom);
}

Usage Notes

Requirements

  • Active 3D view required (not plans or sections)
  • Logger must be enabled
  • RevitDevTool trace panel open

Performance

  • Large collections may impact performance
  • Use representative samples for analysis
  • Clear visualizations regularly

Colors & Display

  • Default colors assigned by geometry type
  • Transparency supported for surfaces
  • Edges displayed for solids and bounding boxes

Related Topics

Clone this wiki locally