Skip to content

Visualization Overview

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

Visualization Module

3D geometry display system using DirectContext3D transient rendering.

Display Revit geometry (curves, faces, solids, meshes, points, bounding boxes) directly in the active 3D view without creating model elements or affecting the Revit database.

Trace Geometry


πŸ“š Documentation

User Guides

Integration


⚑ Quick Start

Python: Visualize Geometry

See visualization_curve_script.py:

from Autodesk.Revit.DB import Line, XYZ

# Create geometry
start = XYZ(0, 0, 0)
end = XYZ(10, 10, 0)
line = Line.CreateBound(start, end)

# Print geometry object - displays in 3D view
print(line)
# Line appears immediately in active 3D view

More examples:

C#: Visualize with TraceGeometry

See RevitDevTool.DotnetDemo/CurveVisualization.cs:

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

// Create geometry
XYZ start = XYZ.Zero;
XYZ end = new XYZ(10, 10, 0);
Line line = Line.CreateBound(start, end);

// Display
TraceGeometry.Show(line);

More examples:


🎨 Supported Geometry Types

1. Curves

  • Line - Straight line segments
  • Arc - Circular arcs
  • Ellipse - Elliptical arcs
  • NurbSpline - Spline curves
  • HermiteSpline - Hermite splines
  • CurveLoop - Closed curve loops
  • PolyLine - Multi-segment polylines

2. Faces

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

3. Solids

  • Solid - 3D solid geometry
  • Displays edges, faces, and vertices

4. Meshes

  • Mesh - Triangulated mesh geometry
  • Supports vertex colors
  • Custom shading

5. Points & Boxes

  • XYZ - Individual points
  • BoundingBoxXYZ - Bounding boxes

See: Complete Geometry Types Reference


πŸ”§ Features

1. Transient Rendering

  • No model elements created
  • No Revit database modifications
  • Appears only in active session
  • Automatic cleanup

2. DirectContext3D

  • Hardware-accelerated rendering
  • High performance
  • Real-time updates
  • Smooth interaction

3. Color & Style

  • Custom colors per geometry
  • Transparency support
  • Line width control
  • Material properties

4. Integration

  • Works with Python scripts
  • C# extension methods
  • Automatic via print(geometry) in Python
  • Manual via TraceGeometry.Show() in C#

5. Multiple Geometries

  • Display multiple objects simultaneously
  • Clear all with single command
  • Selective removal
  • Grouped display

🎯 Common Use Cases

  • Analysis Results - Visualize wall centerlines, room boundaries, analytical geometry
  • Debug Geometry - Test line/curve creation, verify geometry operations
  • Highlight Elements - Show specific elements matching criteria
  • Bounding Boxes - Quick spatial previews of elements
  • Intersection Testing - Display intersection points, overlap geometry
  • Path Visualization - Show circulation paths, piping routes, duct runs

See complete examples:


⚑ Performance Tips

  1. Batch Display - Print multiple geometries in loops
  2. Clear Regularly - Use Clear Geometry button to avoid clutter
  3. Limit Complexity - Avoid displaying thousands of objects at once
  4. Use Simple Types - Lines instead of complex curves, BoundingBoxXYZ for previews
  5. Representative Samples - Show subsets rather than entire collections

πŸ–₯️ UI Features

Geometry Count Badge

The Clear Geometry button displays a live count badge showing the number of geometry objects currently visualized:

  • Badge updates in real-time as geometries are added
  • Shown as a colored indicator on the button
  • Click "Clear Geometry" to remove all visualized objects
  • Located in the main toolbar of TraceLogPage

πŸ› οΈ Technical Details

For developers extending the visualization system:

Visualization Settings


πŸ“– Related Modules


Rendering: DirectContext3D (hardware-accelerated)
Performance: Real-time (60 FPS)
Revit Support: 2022-2026

Clone this wiki locally