Xbim.WexBlazor 1.7.2

dotnet add package Xbim.WexBlazor --version 1.7.2
                    
NuGet\Install-Package Xbim.WexBlazor -Version 1.7.2
                    
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="Xbim.WexBlazor" Version="1.7.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xbim.WexBlazor" Version="1.7.2" />
                    
Directory.Packages.props
<PackageReference Include="Xbim.WexBlazor" />
                    
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 Xbim.WexBlazor --version 1.7.2
                    
#r "nuget: Xbim.WexBlazor, 1.7.2"
                    
#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 Xbim.WexBlazor@1.7.2
                    
#: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=Xbim.WexBlazor&version=1.7.2
                    
Install as a Cake Addin
#tool nuget:?package=Xbim.WexBlazor&version=1.7.2
                    
Install as a Cake Tool

Xbim.WexBlazor

NuGet License: MIT

A Blazor component library for building BIM (Building Information Modeling) applications. Wraps the @xbim/viewer JavaScript library for 3D model visualization in Blazor WebAssembly or Server applications.

Features

  • 3D BIM Viewer - WebGL-based visualization of wexBIM models
  • Plugin System - Navigation cube, grid, section box, clipping planes
  • Sidebar Docking - Dockable/overlay panels with icon bar navigation
  • Property Display - Multi-source property aggregation (IFC, database, custom)
  • Model Hierarchy - Product types and spatial structure navigation
  • Theming - Light/dark themes with customizable colors
  • Direct IFC Loading - Server-side conversion (Blazor Server only)

Two Modes of Operation

This library supports two modes to fit different application needs:

Mode Description Best For
Standalone Self-contained viewer with no backend dependencies SPAs, embedded viewers, prototypes
Platform Integrated with Xbim WexServer for full model management Server apps, team collaboration, cloud storage

Installation

# Add GitHub Packages source (one-time setup)
dotnet add package Xbim.WexBlazor

For platform mode, also install the API client:

dotnet add package Xbim.WexServer.Client

Quick Start

Standalone Mode

Register services for standalone operation (no server required):

// Program.cs
builder.Services.AddWexBlazorStandalone();

Add to _Imports.razor:

@using Xbim.WexBlazor
@using Xbim.WexBlazor.Components

Basic viewer:

<XbimViewer Id="viewer"
               Width="800"
               Height="600"
               ModelUrl="models/building.wexbim"
               OnModelLoaded="HandleModelLoaded" />

@code {
    private void HandleModelLoaded(bool success)
    {
        Console.WriteLine(success ? "Model loaded" : "Load failed");
    }
}

Platform Mode (With WexServer from WexSDK)

Register services with a WexServer connection:

// Program.cs
builder.Services.AddWexServerClient(options =>
{
    options.BaseUrl = "https://your-Xbim-server.com";
});
builder.Services.AddWexBlazorPlatform();

Platform mode enables:

  • Model storage in cloud or on-premises
  • Model versioning and history
  • Property extraction stored in database
  • User authentication and workspace management

Components

XbimViewer

The main viewer component with full model interaction support.

<XbimViewer Id="myViewer"
               Width="100%"
               Height="600"
               BackgroundColor="#F5F5F5"
               ModelUrl="models/SampleModel.wexbim"
               OnViewerInitialized="HandleInit"
               OnModelLoaded="HandleLoad"
               OnPick="HandlePick">
    
</XbimViewer>

Parameters:

  • Id - Unique viewer identifier
  • Width/Height - Dimensions (px or %)
  • BackgroundColor - Canvas background
  • ModelUrl - Initial model URL to load

Events:

  • OnViewerInitialized - Viewer ready
  • OnModelLoaded - Model load complete
  • OnPick - Element selected
  • OnHoverPick - Element hovered

ViewerToolbar

Built-in toolbar with common viewer operations.

<XbimViewer ...>
    <ViewerToolbar Position="ToolbarPosition.Top"
                   ShowResetView="true"
                   ShowZoomControls="true"
                   ShowNavigationModes="true" />
</XbimViewer>

ViewerSidebar + SidebarPanel

Dockable sidebar system with icon-based panel management.

<XbimViewer ...>
    <ViewerSidebar Position="SidebarPosition.Right" DefaultMode="SidebarMode.Docked">
        <SidebarPanel Title="Properties" Icon="bi-info-circle">
            <PropertiesPanel ShowHeader="false" />
        </SidebarPanel>
        <SidebarPanel Title="Hierarchy" Icon="bi-diagram-3">
            <ModelHierarchyPanel ShowHeader="false" />
        </SidebarPanel>
    </ViewerSidebar>
</XbimViewer>

PropertiesPanel

Displays element properties when selected. Auto-subscribes to viewer pick events.

<PropertiesPanel ShowHeader="true" />

ModelHierarchyPanel

Shows model structure with Product Types and Spatial Structure tabs.

<ModelHierarchyPanel ShowHeader="true" />

FileLoaderPanel

UI for loading models from URLs, files, or demo assets.

<FileLoaderPanel AllowIfcFiles="true" OnFileLoaded="HandleFile" />

Plugins

Add viewer plugins for enhanced functionality:

<XbimViewer @ref="_viewer" ...>
    <NavigationCubePlugin Opacity="0.7" />
    <GridPlugin Spacing="1000" Color="#CCCCCC" />
    <SectionBoxPlugin />
    <ClippingPlanePlugin />
</XbimViewer>

Theming

Register and configure the theme service:

// Program.cs
var themeService = new ThemeService();
themeService.SetTheme(ViewerTheme.Dark);
themeService.SetAccentColors(lightColor: "#0969da", darkColor: "#4da3ff");
builder.Services.AddSingleton(themeService);

Toggle theme at runtime:

@inject ThemeService ThemeService

<button @onclick="() => ThemeService.ToggleTheme()">Toggle Theme</button>

Property Sources

The library supports multiple property sources for element data.

IFC Property Source (Blazor Server)

var model = IfcStore.Open("model.ifc");
var propertySource = new IfcPropertySource(model, viewerModelId);
propertyService.RegisterSource(propertySource);

Custom Property Source

var apiSource = new CustomPropertySource(
    async (query, ct) =>
    {
        var data = await api.GetPropertiesAsync(query.ElementId);
        return new ElementProperties { /* ... */ };
    },
    sourceType: "REST API",
    name: "API Properties"
);
propertyService.RegisterSource(apiSource);

Dictionary Property Source

var dictSource = new DictionaryPropertySource(name: "Custom");
dictSource.AddProperty(elementId: 123, modelId: 0,
    groupName: "Status", propertyName: "Approved", value: "Yes");
propertyService.RegisterSource(dictSource);

IFC Loading (Blazor Server Only)

Direct IFC file loading with automatic wexBIM conversion:

// Program.cs
builder.Services.AddSingleton<IfcModelService>();
builder.Services.AddSingleton<IfcHierarchyService>();
@inject IfcModelService IfcService

var result = await IfcService.ProcessIfcBytesAsync(ifcData, "model.ifc");
if (result.Success)
{
    await Viewer.LoadModelFromBytesAsync(result.WexbimData!, "model.ifc");
}

Requirements

  • .NET 9.0+
  • Node.js 20+ (for TypeScript compilation)
  • Blazor WebAssembly or Blazor Server

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos 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
1.7.2 83 2/23/2026
1.7.1 87 2/18/2026
1.7.0 109 1/24/2026
1.6.0 100 1/23/2026
1.5.1 103 1/22/2026
1.5.0 93 1/21/2026
1.4.0 91 1/20/2026
1.3.1 92 1/14/2026
1.3.0 93 1/14/2026
1.2.0 93 1/13/2026
1.1.0 97 1/12/2026
1.0.5 99 1/9/2026
1.0.4 102 1/9/2026
1.0.3 93 1/9/2026
1.0.2 95 1/9/2026
1.0.1 93 1/9/2026
1.0.0 102 1/9/2026