AlibreObjectModel 2.0.0

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

AlibreObjectModel (.NET library)

AlibreObjectModel wraps the Alibre Design CAD API (sessions, sketches, features, parameters, topology) in a typed .NET object model. Alibre.Attach() is the entry point. Failures arrive as specific exceptions carrying the COM HRESULT, not bare COMException.

Package ID AlibreObjectModel
Entry point Alibre.Attach()
Target framework net8.0
Built against Alibre Design 29.0.1.29069
Runtime Windows only, x64
License MIT

Requirements

  • Windows x64.
  • Alibre Design 29.0.1.29069, installed and running. This package is compiled against that release's AlibreX.dll. Each Alibre release can add AlibreX APIs, so a different Alibre version may not expose everything this build expects. The library drives Alibre over COM and does not redistribute AlibreX.dll; it loads that at runtime from your licensed install.

Installation

dotnet add package AlibreObjectModel

Or add a PackageReference:

<PackageReference Include="AlibreObjectModel" Version="2.0.0" />

Getting started

using AlibreObjectModel;

try
{
    var root = Alibre.Attach();
    PartSession part = root.ActiveSession.AsPart();

    var sketch = part.CreateSketchXY("Profile")
        .BeginEdit()
        .AddRectangle(-50, -30, 50, 30);
    var result = sketch.EndEdit();
    Console.WriteLine($"Sketch: IsClosed={result.IsClosed}");

    var extrusion = part.CreateExtrudedBoss(sketch, 40.0, "Box");
    Console.WriteLine($"Created: {extrusion.Name}");
}
catch (AlibreConnectionException ex)
{
    Console.WriteLine($"Connection failed: {ex.Message}");
}
catch (SketchNotClosedException ex)
{
    Console.WriteLine($"Sketch '{ex.SketchName}' must be closed to extrude");
}
catch (FeatureException ex)
{
    Console.WriteLine($"Feature '{ex.FeatureName}' failed: {ex.Message}");
}

Object model

  • Alibre.Attach(): entry point, returns Root.
  • Root: ActiveSession, Sessions, CreateEmptyPart, OpenFile, Native.
  • Session and its typed forms PartSession, AssemblySession, DrawingSession, reached with AsPart() / AsAssembly() / AsDrawing().
  • Sketch: BeginEdit, geometry methods, EndEdit, validation.
  • ExtrusionFeature and the static Create / Get / Set helpers.

Every wrapper exposes the underlying COM interface through .Native, so nothing in the raw API is out of reach:

IADPartSession comPart = part.Native;

Exceptions

AlibreException (base, carries the COM HRESULT)
├── AlibreConnectionException      could not attach to Alibre
├── SessionException               session operation failed
│   └── SessionTypeMismatchException
├── SketchException                sketch operation failed
│   ├── SketchNotClosedException   profile is not closed
│   └── SketchEmptyException       sketch has no geometry
├── FeatureException               feature creation failed
├── GeometryException              sketch geometry failed
├── ParameterException             parameter operation failed
│   └── ParameterNotFoundException
├── TopologyException              topology query failed
└── FileOperationException         file open or save failed

Upgrading from 1.0.0

Version 2.0.0 removes raw AlibreX COM types from the public API. Thirteen signatures changed, in two groups. Both are compile-time breaks with mechanical fixes; nothing changes at runtime.

Nine return-type changes. The call is the same, but you get a wrapper instead of a COM interface. Append .Native to keep exactly what 1.0.0 gave you.

member 1.0.0 returned 2.0.0 returns
Root.ActiveSession IADSession Session
Root.TopmostSession IADSession Session
Root.OpenFile IADSession Session
Root.CreateEmptyPart IADPartSession PartSession
Root.CreateEmptyAssembly IADAssemblySession AssemblySession
Root.CreateEmptyDrawing IADDrawingSession DrawingSession
Create.Part(Root, …) IADPartSession PartSession
Create.Assembly(Root, …) IADAssemblySession AssemblySession
Create.Drawing(Root, …) IADDrawingSession DrawingSession
// 1.0.0
IADPartSession com = root.CreateEmptyPart("Bracket", false);

// 2.0.0 — same call, same underlying object, one suffix
IADPartSession com = root.CreateEmptyPart("Bracket", false).Native;

Four relocations. The Create.Sketch* overloads that took an IADPartSession are now methods on PartSession.

1.0.0 2.0.0
Create.SketchXY(IADPartSession, name) PartSession.CreateSketchXY(name)
Create.SketchXZ(IADPartSession, name) PartSession.CreateSketchXZ(name)
Create.SketchYZ(IADPartSession, name) PartSession.CreateSketchYZ(name)
Create.Sketch(IADPartSession, plane, name) PartSession.CreateSketch(plane, name)

Create itself stays. Create.Part, Create.Assembly and Create.Drawing are unchanged apart from their return type, Create.ExtrudedBoss keeps its COM overload and gains a wrapper one, and equivalents of the four relocated methods remain as Create.SketchXY(PartSession, name) and friends. Create.ExtrudedCut is new in 2.0.0 — 1.0.0 had no cut helper.

Watch for two knock-on breaks the tables cannot show:

  • root.ActiveSession.IsPart() stops compiling. ActiveSession is now a Session, where IsPart is a property, so the call parentheses are the error. The IADSession extension method is still there — root.ActiveSession.Native.IsPart() works, but root.ActiveSession.IsPart is what you want.
  • Anything handed to Get, Set or ModelValidation needs .Native, since those still take COM interfaces.

Using var hides both until a later member lookup fails.

Version 1.0.0 stays published and unchanged if you are not ready to move.


© 2026 Stephen S. Mitchell. Released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.
  • net8.0

    • No dependencies.

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
2.0.0 111 8/10/2026
1.0.0 178 1/25/2026

v2.0.0 - BREAKING CHANGES: improved COM exception handling and object model.