GeometryHelper.CadConvert 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package GeometryHelper.CadConvert --version 3.0.0
                    
NuGet\Install-Package GeometryHelper.CadConvert -Version 3.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="GeometryHelper.CadConvert" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GeometryHelper.CadConvert" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GeometryHelper.CadConvert" />
                    
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 GeometryHelper.CadConvert --version 3.0.0
                    
#r "nuget: GeometryHelper.CadConvert, 3.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 GeometryHelper.CadConvert@3.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=GeometryHelper.CadConvert&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GeometryHelper.CadConvert&version=3.0.0
                    
Install as a Cake Tool

GeometryHelper.CadConvert

NuGet Version License: MIT

Converts geometry between AutoCAD and GeometryHelper, both ways: points, vectors, line segments and Line entities, polylines, polygons, circles, and Extents2d/Extents3d as rectangles.

Installation

dotnet add package GeometryHelper.CadConvert

You must add the AutoCAD assemblies yourself

This package does not contain any AutoCAD assembly. They are Autodesk's to distribute rather than ours, so it ships only its own code and leaves those references to you. Until you add them, code that touches this library fails to compile with CS0012: the type is defined in an assembly that is not referenced.

The library itself resolves against acdbmgd.dll alone — that is where Point3d, Polyline, Circle, Line and Extents3d live. A plugin normally also wants acmgd.dll and accoremgd.dll for the editor and application APIs, so all three are shown below.

Take them from either source:

From your AutoCAD installation — the usual choice, because it guarantees you build against the same version you run:

<Reference Include="accoremgd">
  <HintPath>C:\Program Files\Autodesk\AutoCAD 2024\accoremgd.dll</HintPath>
  <Private>false</Private>
</Reference>
<Reference Include="acdbmgd">
  <HintPath>C:\Program Files\Autodesk\AutoCAD 2024\acdbmgd.dll</HintPath>
  <Private>false</Private>
</Reference>
<Reference Include="acmgd">
  <HintPath>C:\Program Files\Autodesk\AutoCAD 2024\acmgd.dll</HintPath>
  <Private>false</Private>
</Reference>

Or from Autodesk's own package on nuget.org:

dotnet add package AutoCAD.NET

Keep Copy Local false. AutoCAD supplies those assemblies at run time from its own installation, and a copy sitting next to your plugin risks loading a build that does not match the running AutoCAD.

Which AutoCAD version

The package is built against the AutoCAD 2024 API (assembly version 24.0.0.0). Autodesk keeps the Autodesk.AutoCAD.Geometry and Autodesk.AutoCAD.DatabaseServices types this library touches stable across releases, so building from source against another version needs no source changes.

AutoCAD.NET on nuget.org carries no netstandard2.0 assets — version 24–25 ship net47 and version 26 ships net10.0 — so a project taking that dependency has to target the framework matching the AutoCAD it runs in. Referencing the DLLs directly, as above, avoids that constraint.

Usage

using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using GeometryHelper.CadConvert;
using GeometryHelper.PlaneGeometry.Geometry;

// AutoCAD to GeometryHelper
GeoPoint2 point = new Point3d(100, 200, 0).ToGeoPoint2();
GeoPolyline2 path = acadPolyline.ToGeoPolyline2();
GeoRectangle2 bounds = extents.ToGeoRectangle2();
GeoCircle2 circle = acadCircle.ToGeoCircle2();

// GeometryHelper back to AutoCAD
Polyline drawn = path.ToAcadPolyline();
Line drawnLine = geoLine.ToAcadLine();
Point3d back = point.ToAcadPoint3();

Point chains

EnumerableExtension covers the step before a polyline exists: a raw list of points read out of a drawing, usually carrying more of them than the geometry needs.

// Drop points that sit within the tolerance of the point kept before them.
List<Point3d> thinned = points.RemoveConsecutiveNearPoints(0.5);

// One segment per consecutive pair; the chain is left open.
List<LineSegment3d> segments = thinned.ToLineSegments3d();

LineSegment3d longest = segments.GetLongestLength();

RemoveConsecutiveNearPoints compares each point against the last one kept, not against its original neighbour, which is what guarantees no two points of the result are within the tolerance of each other. The first point always survives; the last one is not privileged, so re-append it yourself when the endpoint matters.

Licence

MIT. The AutoCAD assemblies this library compiles against are covered by Autodesk's own licence terms, not by this one.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
9.0.2 34 10/1/2026
9.0.1 30 10/1/2026
9.0.0 37 10/1/2026
8.0.0 38 9/30/2026
7.0.0 66 9/29/2026
6.3.0 71 9/29/2026
6.2.0 63 9/29/2026
6.1.0 78 9/28/2026
6.0.0 78 9/28/2026
5.1.0 97 9/21/2026
5.0.0 89 9/21/2026
4.0.0 94 9/18/2026
3.2.0 98 9/17/2026
3.1.0 106 8/28/2026
3.0.2 115 8/23/2026
3.0.0 119 8/23/2026

Converts geometry between AutoCAD and GeometryHelper, both ways: points, vectors, line segments
     and Line entities, polylines, polygons, circles, and Extents2d/Extents3d as rectangles.

     REQUIRES AUTOCAD ASSEMBLIES YOU MUST SUPPLY
     - No AutoCAD assembly is redistributed here, because they are Autodesk's to ship rather than
       ours. Reference them yourself, either from your AutoCAD installation folder or from Autodesk's
       own AutoCAD.NET package on nuget.org. Without them the compiler reports CS0012.
     - This library resolves against acdbmgd.dll alone; a plugin normally also wants acmgd.dll and
       accoremgd.dll for the editor and application APIs.
     - Reference them with Copy Local set to false. AutoCAD supplies them at run time from its own
       installation, and a copy sitting next to your plugin risks loading a build that does not match
       the running AutoCAD.
     - This package is built against the AutoCAD 2024 API (assembly version 24.0.0.0).

     EXTENSIONS
     - GeometryHelper.CadConvert also carries EnumerableExtension: chaining a list of Point2d or
       Point3d into segments, thinning a chain of points by a tolerance, and picking the longest
       segment out of a list.