Autodesk Revit plugin project organized into multiple solution files that target versions 2021 - 2026.
- RevitDevTool
RevitDevTool is a comprehensive debugging and visualization toolkit for Autodesk Revit that helps developers and users trace, visualize, and debug their Revit applications. The tool provides two main capabilities: Trace Logging and Geometry Visualization with beautiful canvas rendering.
Capture and view all trace output with color-coded log levels directly in Revit

Watch as all Trace.TraceInfomation(), Trace.TraceWarning(), and Trace.TraceError calls appear in real-time with color-coded severity levels.
Visualize any Revit geometry (curves, faces, solids, meshes) in real-time

Simply call Trace.Write(geometry) to visualize any Revit geometry object - curves, faces, solids, meshes, and bounding boxes rendered directly in your 3D view.
Export logs to multiple formats: Plain Text, JSON, CLEF, SQLite Database

Configure and export your logs to multiple formats including plain text (.log), JSON (.json), CLEF (.clef) for Seq integration, or SQLite database (.db) for advanced querying.
Automatically shows trace window when events occur with no document open

The trace window automatically opens when trace events occur and no document is open, helping you catch startup issues and initialization problems.
- Install RevitDevTool: Use the MSI installer or place the Autodesk bundle in your Revit add-ins folder
- Launch Revit: The tool will automatically register and appear in the External Tools panel
- Open Trace Panel: Click the "Trace Panel" button in the ribbon to show/hide the dockable panel
The Trace Log provides a real-time, color-coded logging interface directly within Revit, similar to Visual Studio's output window.
- Real-time logging with configurable log levels (Debug, Information, Warning, Error, Fatal)
- Color-coded output for easy identification of different log types
- Console redirection - captures
Console.WriteLine()output - Auto-start listening on Revit startup
- Cascadia Mono font for better readability
- Clear function to reset the log output
- Enable Logging: Open the
Trace LogDockablePanel and ensure the logger isenabled - Configure Log Level: Select your desired minimum log level from the dropdown (Debug, Information, Warning, Error, Fatal)
- Start Logging: Use any of the following methods in your C# code:
// Information logging
Trace.TraceInformation("Application started successfully");
// Warning logging
Trace.TraceWarning("Element not found, using default values");
// Error logging
Trace.TraceError("Failed to process element: " + exception.Message);
// Debug logging
Debug.WriteLine("Debug information: " + debugInfo);
// Console output (automatically captured)
Console.WriteLine("This will appear in the trace log");import clr
# For Revit 2025 onward, use these references:
clr.AddReference("System.Diagnostics.TraceSource")
clr.AddReference("System.Console")
from System.Diagnostics import Trace
from System import Console
# Use the same Trace methods
Trace.TraceInformation("Python script executed")
Trace.TraceWarning("Warning from Python")
Trace.TraceError("Error in Python script")
# Console output is also captured
print("This will appear in the trace log")
Console.WriteLine("Direct console output from Python")The Geometry Visualization system allows you to display transient geometry directly in the Revit 3D view, similar to Dynamo's preview functionality but integrated into your development workflow.
- Faces - Surface geometry from Revit elements
- Curves - Lines, arcs, splines, and complex curve geometry
- Solids - 3D solid geometry with volume
- Meshes - Triangulated mesh geometry
- Points (XYZ) - Individual points or point collections
- Bounding Boxes - Element bounding box visualization
- Collections - Multiple geometry objects at once
- Transient Display - use Revit's DirectContext3D for rendering which inspired by RevitLookup
- Automatic Cleanup - Geometry is removed when document closes
- Manual Control - Use
ClearGeometryto remove geometry on demand,Clear Logto clear log messages - Performance Optimized - Efficient rendering/Disposal of geometry
- Supports Mixed Geometry Types - Trace collections of different geometry types in one call
-
Enable Geometry Tracing: Ensure the logger is started (geometry tracing is automatically enabled)
-
Trace Single Geometry Objects:
// Trace a face
Face face = GetSomeFace();
Trace.Write(face);
// Trace a curve
Curve curve = GetSomeCurve();
Trace.Write(curve);
// Trace a solid
Solid solid = GetSomeSolid();
Trace.Write(solid);
// Trace a mesh
Mesh mesh = GetSomeMesh();
Trace.Write(mesh);
// Trace a point
XYZ point = new XYZ(10, 20, 30);
Trace.Write(point);
// Trace a bounding box
BoundingBoxXYZ bbox = element.get_BoundingBox(null);
Trace.Write(bbox);- Trace Multiple Geometry Objects:
// Trace multiple faces
var faces = new List<Face> { face1, face2, face3 };
Trace.Write(faces);
// Trace multiple curves
var curves = selectedElements.SelectMany(e => GetCurvesFromElement(e));
Trace.Write(curves);
// Trace multiple solids
var solids = elements.SelectMany(e => e.GetSolids());
Trace.Write(solids);
// Mixed geometry types
var geometries = new List<GeometryObject> { face, curve, solid };
Trace.Write(geometries);import clr
clr.AddReference("RevitAPI")
# For Revit 2025 onward, use these references:
clr.AddReference("System.Diagnostics.TraceSource")
clr.AddReference("System.Console")
from Autodesk.Revit.DB import *
from System.Diagnostics import Trace
from System.Collections.Generic import List
# Trace individual geometry
face = GetSomeFace() # Your method to get a face
Trace.Write(face)
# Trace collections
curves = List[Curve]()
curves.Add(curve1)
curves.Add(curve2)
Trace.Write(curves)
# Trace points
point = XYZ(10, 20, 30)
Trace.Write(point)foreach (Element element in selectedElements)
{
Trace.TraceInformation($"Processing element: {element.Id}");
var solids = element.GetSolids();
if (solids.Any())
{
Trace.Write(solids);
Trace.TraceInformation($"Found {solids.Count} solids");
}
else
{
Trace.TraceWarning($"No solids found for element {element.Id}");
}
}// Visualize structural analysis results
var analysisPoints = CalculateStressPoints(beam);
Trace.Write(analysisPoints);
// Show critical areas
var criticalFaces = GetCriticalFaces(beam);
Trace.Write(criticalFaces);
Trace.TraceInformation($"Analysis complete: {analysisPoints.Count} points analyzed");# Python script for geometry analysis
import clr
clr.AddReference("RevitAPI")
# For Revit 2025 onward, use these references:
clr.AddReference("System.Diagnostics.TraceSource")
clr.AddReference("System.Console")
from Autodesk.Revit.DB import *
from System.Diagnostics import Trace
def analyze_walls(walls):
Trace.TraceInformation("Starting wall analysis...")
for wall in walls:
# Get wall geometry
geometry = wall.get_Geometry(Options())
for geo_obj in geometry:
if isinstance(geo_obj, Solid) and geo_obj.Volume > 0:
# Visualize the solid
Trace.Write(geo_obj)
# Log information
Trace.TraceInformation(f"Wall {wall.Id}: Volume = {geo_obj.Volume}")
# Usage
selected_walls = [doc.GetElement(id) for id in uidoc.Selection.GetElementIds()]
analyze_walls(selected_walls)- Dockable Panel: Integrated seamlessly with Revit's interface
- Responsive Design: Works with Revit's light and dark themes (2024+)
- Resizable: Minimum 300x400 pixels, can be resized as needed
- Keyboard Shortcuts: Standard copy/paste functionality in the log view
- Auto-scroll: Automatically scrolls to show new log entries
- Log Level Filtering: Real-time filtering of log messages
RevitDevTool works with multiple programming languages and scripting environments:
- C# - Full support through .NET Trace API
- VB.NET - Full support through .NET Trace API
- Python/IronPython - Full support via pyRevit, RevitPythonShell, or IronPython scripts
- F# - Support through .NET interop
- Any .NET Language - Works with any language that can access System.Diagnostics.Trace
- Use Appropriate Log Levels: Use Information for general status, Warning for non-critical issues, Error for problems
- Clear Geometry Regularly: Use the Clear Geometry button to avoid cluttering the view
- Meaningful Messages: Include element IDs, counts, and relevant context in log messages
- Performance Considerations: Large geometry collections may impact performance
- Document Workflow: Use logging to document your script's progress and results
- No Geometry Visible: Ensure the logger is enabled and you can reset by toggling the
Start/Stop Listener - Geometry Persists: Use "Clear Geometry" button
- Missing Logs: Check that the log level is set appropriately for your trace calls
- Performance Issues: Reduce the number of geometry objects traced simultaneously
Special thanks to:
- RevitLookup - For the beautiful DirectContext3D implementation that powers our geometry visualization
- RevitDevTool (Original) - For the original idea and inspiration for this project