Su.Revit.HelixToolkit.SharpDX 2026.1.0

dotnet add package Su.Revit.HelixToolkit.SharpDX --version 2026.1.0
                    
NuGet\Install-Package Su.Revit.HelixToolkit.SharpDX -Version 2026.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Su.Revit.HelixToolkit.SharpDX" Version="2026.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Su.Revit.HelixToolkit.SharpDX" Version="2026.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Su.Revit.HelixToolkit.SharpDX" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Su.Revit.HelixToolkit.SharpDX --version 2026.1.0
                    
#r "nuget: Su.Revit.HelixToolkit.SharpDX, 2026.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Su.Revit.HelixToolkit.SharpDX@2026.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Su.Revit.HelixToolkit.SharpDX&version=2026.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Su.Revit.HelixToolkit.SharpDX&version=2026.1.0
                    
Install as a Cake Tool

๐Ÿš€ Su.Revit.HelixToolkit.SharpDX User Guide

๐ŸŒ Project Repository

GitHub: https://github.com/ViewSuSu/Su.Revit.HelixToolkit.SharpDX
Gitee: https://gitee.com/SususuChang/su.-revit.-helix-toolkit.-sharp-dx


๐Ÿ“ฆ Installation

# Package Manager
Install-Package Su.Revit.HelixToolkit.SharpDX

# .NET CLI
dotnet add package Su.Revit.HelixToolkit.SharpDX

Compatibility

  • โœ… Supported Versions: Revit 2011 - Revit 2026
  • โœ… .NET Framework: 4.8+
  • โœ… Dependencies: HelixToolkit.Wpf.SharpDX, Revit API

๐Ÿ“– Introduction

Su.Revit.HelixToolkit.SharpDX is a high-performance 3D visualization toolkit specifically designed for Revit plugin development. Built on HelixToolkit.Wpf.SharpDX, it provides simple and easy-to-use APIs to create feature-rich 3D viewport windows in Revit plugins.

Core Features:

  • ๐Ÿš€ High-Performance Rendering: Index optimization for Solid triangular faces, capable of handling massive triangular face data in Solid models
  • ๐ŸŽฏ Complete Interaction: Supports mouse hover highlighting, click selection, multi-selection, rotation, zoom, pan, and other complete interaction functions
  • ๐Ÿ“ Coordinate System Adaptation: Automatic handling of coordinate system conversion between Revit and Helix for seamless integration
  • ๐ŸŽจ Material System: Supports multiple rendering methods including native Revit materials, custom colors, and texture materials
  • โšก Memory Optimization: Efficient geometric data management and memory release mechanisms

๐ŸŽฏ Quick Start

โšก Basic Usage

// 1. ๐Ÿ“ฆ Initialize the builder
var builder = HelixViewport3DBuilder.Init(
    revitDocument, 
    geometryObjects, 
    new Viewport3DXOptions()
);

// 2. ๐Ÿ–ฅ๏ธ Get the 3D viewport control
Viewport3DX viewport = builder.Viewport;

// 3. ๐Ÿ“ Add viewport to your WPF window

๐Ÿ”ฅ Complete Example

// Prepare geometry objects to display
var geometryObjects = new List<GeometryObjectOptions>
{
    // Add your geometry objects...
};

// ๐ŸŽจ Configure viewport options
var visualOptions = new Viewport3DXOptions
{
    BackgroundColor = System.Windows.Media.Colors.LightGray,
    FXAALevel = 4 // Anti-aliasing level
};

// ๐Ÿ—๏ธ Create builder
var builder = HelixViewport3DBuilder.Init(
    document, 
    geometryObjects, 
    visualOptions
);

// ๐Ÿ“ Set camera view
builder.SetCamera(revitView);

// โœจ Enable interaction features
builder.SetHoverHighlightEnabled(true)
       .SetClickHighlightEnabled(true);

๐ŸŽฎ Interaction Features

๐Ÿ–ฑ๏ธ Mouse Operations

Operation Function Icon
๐Ÿ–ฑ๏ธ Middle Double-Click Zoom to extent ๐Ÿ”
๐Ÿ–ฑ๏ธ Middle Drag Pan view ๐Ÿ‘
๐Ÿ–ฑ๏ธ Shift + Right Click Rotate view ๐Ÿ”„
๐Ÿ–ฑ๏ธ Mouse Hover Semi-transparent highlight ๐Ÿ‘†
๐Ÿ–ฑ๏ธ Left Click Select model โœ…
๐Ÿ–ฑ๏ธ Ctrl + Click Multi-select models ๐Ÿ“‹

๐ŸŽจ Highlight Features

// ๐ŸŒˆ Set highlight color
builder.SetHighlightColor(Colors.Red, 0.8f);  // Red highlight

// ๐Ÿ’ซ Enable blinking effect
builder.SetHighlightBlinking(true, 100);  // 100ms blink interval

// ๐Ÿ”ง Programmatically highlight specific objects
builder.HighlightGeometryObject(specificGeometry);

๐Ÿ“Š View Control

๐ŸŽฅ Camera Settings

// Method 1: Use Revit view
builder.SetCamera(revitView);

// Method 2: Custom camera
builder.SetCamera(
    new XYZ(0, 0, 10),     // ๐Ÿ“ Camera position
    new XYZ(0, 0, -1),     // ๐Ÿ‘€ Look direction
    new XYZ(0, 1, 0)       // โฌ†๏ธ Up direction
);

๐Ÿงญ Navigation Controls

  • โœ… View Cube: Displayed at top-right, click for quick view switching
  • โœ… Auto Zoom: Automatically adjusts to suitable view range on load
  • โœ… Anti-aliasing: Configurable graphics quality settings

๐Ÿ› ๏ธ Advanced Features

๐Ÿ“ก Event Listening

// ๐Ÿ‘‚ Listen to model selection events
builder.OnModelSelected += (sender, args) => 
{
    var selectedModel = args.SelectedModel;
    var geometryObject = args.GeometryObject;
    var hitPoint = args.HitPoint;
    
    // ๐ŸŽฏ Handle selection logic
    Console.WriteLine($"Selected model: {geometryObject}");
};

// ๐Ÿ‘‚ Listen to deselection events
builder.OnModelDeselected += (sender, args) => 
{
    // ๐Ÿ—‘๏ธ Clear selection state
};

๐Ÿ” Selection Management

// ๐Ÿ“‹ Get currently selected models
var selectedModels = builder.GetSelectedModels();

// ๐Ÿ“‹ Get currently selected geometry objects
var selectedGeometry = builder.GetSelectedGeometryObjects();

// ๐Ÿงน Clear all selections
builder.ClearHighlight();

โš™๏ธ Configuration Options

๐ŸŽจ Visual Configuration

var options = new Viewport3DXOptions
{
    BackgroundColor = Colors.Black,      // ๐ŸŽจ Background color
    FXAALevel = 8,                       // ๐Ÿ” Anti-aliasing level (0-8)
    EnableRenderFrustum = true          // ๐ŸŽฏ Frustum culling
};

๐Ÿ”ง Feature Toggles

// Enable/disable hover highlight
builder.SetHoverHighlightEnabled(true);

// Enable/disable click highlight  
builder.SetClickHighlightEnabled(true);

๐ŸŽจ GeometryObjectOptions Usage Guide

๐Ÿ“ Basic Configuration

GeometryObjectOptions is used to configure how geometry objects are rendered:

Using Revit Material
var options = new GeometryObjectOptions(
    geometryObject,    // ๐Ÿ“ Revit geometry object
    revitMaterial      // ๐ŸŽจ Revit material (optional)
);
Using Custom Color
var options = new GeometryObjectOptions(
    geometryObject,           // ๐Ÿ“ Revit geometry object
    Colors.Blue,              // ๐Ÿ”ต Custom color
    0.8f                      // ๐Ÿ’ง Transparency (0-1)
);
Using Texture Material
var options = new GeometryObjectOptions(
    geometryObject,           // ๐Ÿ“ Revit geometry object
    textureStream,            // ๐Ÿ–ผ๏ธ Texture stream
    Colors.White,             // โšช Emissive color
    1.0f                      // ๐Ÿ’ง Transparency
);

โš™๏ธ Rendering Parameter Configuration

var options = new GeometryObjectOptions(geometryObject, material)
{
    LevelOfDetail = 0.8,                              // ๐ŸŽฏ Detail level (0-1)
    MinAngleInTriangle = 0,                           // ๐Ÿ“ Minimum triangle angle
    MinExternalAngleBetweenTriangles = Math.PI / 4,   // ๐Ÿ“ Minimum external angle between triangles
    IsDrawSolidEdges = true,                          // ๐Ÿ“ Draw outline edges
    SolidEdgeThickness = 2f,                          // ๐Ÿ–Š๏ธ Edge thickness
    SolidEdgeSmoothness = 10f                         // โœจ Edge smoothness
};

๐Ÿ”ง Parameter Description

Parameter Description Default Impact
LevelOfDetail Rendering detail level 0.5 Higher values create denser meshes, better precision but higher performance cost
MinAngleInTriangle Minimum angle in triangle 0 Controls smoothness during mesh generation
MinExternalAngleBetweenTriangles Minimum external angle between adjacent triangles 2ฯ€ Determines smooth transition between surfaces
IsDrawSolidEdges Whether to draw outline edges true Display boundary lines
SolidEdgeThickness Edge line thickness 2f Line width in pixels
SolidEdgeSmoothness Edge line smoothness 10f Higher values create smoother edges

๐Ÿ’ก Usage Tips

๐Ÿš€ Performance Optimization

  • โœ… Use EnableSwapChainRendering to improve rendering performance
  • โœ… Set appropriate FXAALevel to balance quality and performance
  • โœ… Call Clear() promptly to release resources
  • โœ… Adjust LevelOfDetail based on requirements to avoid unnecessary details
  • โœ… Utilize Solid triangular face index optimization to handle massive data

๐ŸŽฏ Best Practices

  1. ๐Ÿ“ฑ Responsive Design: Viewport automatically adapts to container size
  2. ๐Ÿ”„ Real-time Updates: Support dynamic add/remove of geometry objects
  3. ๐ŸŽฎ User Friendly: Provide intuitive mouse interaction feedback
  4. ๐ŸŽจ Visual Consistency: Maintain visual style similar to Revit
  5. โšก Performance Balance: Adjust rendering parameters based on scene complexity
  6. ๐Ÿ’พ Memory Management: Timely cleanup of unused geometry objects

๐Ÿ”„ Scene Management

// ๐Ÿงน Clear scene
builder.Clear();

// ๐Ÿ“ฆ Re-add objects
builder.Add(newGeometryObjects);

// ๐ŸŽฏ Reset camera
builder.SetCamera(newView);

โ“ Frequently Asked Questions

โ“ How to change highlight color?

builder.SetHighlightColor(Colors.Blue, 0.7f);  // ๐Ÿ”ต Blue highlight

โ“ How to disable all interactions?

builder.SetHoverHighlightEnabled(false)
       .SetClickHighlightEnabled(false);

โ“ How to get world coordinates of click position?

builder.OnModelSelected += (sender, args) => 
{
    var worldPosition = args.HitPoint;  // ๐ŸŒ World coordinates
};

โ“ How to optimize performance for complex models?

var options = new GeometryObjectOptions(geometryObject, material)
{
    LevelOfDetail = 0.3,      // ๐ŸŽฏ Reduce detail level
    IsDrawSolidEdges = false  // ๐Ÿ“ Disable edge drawing
};

โ“ How to handle material transparency?

// Method 1: Use color transparency
var options = new GeometryObjectOptions(geometryObject, Colors.Red, 0.5f);

// Method 2: Use Revit material transparency
var material = document.GetElement(materialId) as Autodesk.Revit.DB.Material;
var options = new GeometryObjectOptions(geometryObject, material);

โ“ How to handle Solid models with massive triangular faces?

// The library has built-in triangular face index optimization, automatically handling massive data
// Just create GeometryObjectOptions normally
var options = new GeometryObjectOptions(largeSolidModel, material);

๐Ÿ“ž Technical Support

If you encounter issues during use, please check:

  • โœ… Revit document object is correctly passed
  • โœ… Geometry object collection contains valid data
  • โœ… Viewport control is properly added to WPF visual tree
  • โœ… Event handlers are correctly registered and unregistered
  • โœ… Rendering parameters are within reasonable ranges
  • โœ… Memory usage is normal, call Clear() promptly to release resources

๐Ÿ” Debugging Tips

// Check selected models
var selected = builder.GetSelectedModels();
Console.WriteLine($"Selected {selected.Count()} models");

// Check geometry object mapping
var geometryObjects = builder.GetSelectedGeometryObjects();
foreach (var geoObj in geometryObjects)
{
    Console.WriteLine($"Geometry object type: {geoObj.GetType()}");
}

๐Ÿ“š Additional Resources

  • ๐Ÿ“– Full Source Code: Visit the GitHub or Gitee repository above
  • ๐Ÿ› Issue Reporting: Welcome to submit issues in the repository
  • ๐Ÿ’ก Feature Suggestions: Welcome to submit Pull Requests or feature suggestions
  • ๐Ÿ“‹ Release Notes: Check the repository's Release page for latest version information

๐ŸŽ‰ Start using Su.Revit.HelixToolkit.SharpDX to create outstanding 3D visualization experiences!

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.1.0 209 11/24/2025
2025.1.0 196 11/24/2025
2024.1.0 200 11/24/2025
2023.1.0 194 11/24/2025
2022.1.0 197 11/24/2025
2021.1.0 194 11/24/2025
2020.1.0 198 11/24/2025
2019.1.0 195 11/24/2025
2018.1.0 197 11/24/2025
2017.1.0 193 11/24/2025
2016.1.0 198 11/24/2025
2015.1.0 204 11/24/2025
2014.1.0 194 11/24/2025
2013.1.0 198 11/24/2025