AlibreObjectModel 2.0.0
dotnet add package AlibreObjectModel --version 2.0.0
NuGet\Install-Package AlibreObjectModel -Version 2.0.0
<PackageReference Include="AlibreObjectModel" Version="2.0.0" />
<PackageVersion Include="AlibreObjectModel" Version="2.0.0" />
<PackageReference Include="AlibreObjectModel" />
paket add AlibreObjectModel --version 2.0.0
#r "nuget: AlibreObjectModel, 2.0.0"
#:package AlibreObjectModel@2.0.0
#addin nuget:?package=AlibreObjectModel&version=2.0.0
#tool nuget:?package=AlibreObjectModel&version=2.0.0
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 redistributeAlibreX.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, returnsRoot.Root:ActiveSession,Sessions,CreateEmptyPart,OpenFile,Native.Sessionand its typed formsPartSession,AssemblySession,DrawingSession, reached withAsPart()/AsAssembly()/AsDrawing().Sketch:BeginEdit, geometry methods,EndEdit, validation.ExtrusionFeatureand the staticCreate/Get/Sethelpers.
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.ActiveSessionis now aSession, whereIsPartis a property, so the call parentheses are the error. TheIADSessionextension method is still there —root.ActiveSession.Native.IsPart()works, butroot.ActiveSession.IsPartis what you want.- Anything handed to
Get,SetorModelValidationneeds.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 | Versions 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. |
-
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.
v2.0.0 - BREAKING CHANGES: improved COM exception handling and object model.