Skip to content

autocad-dotnet

Comprehensive AutoCAD .NET API reference for plugin development. Use when writing AutoCAD .NET plugins, working with ObjectARX managed wrappers, creating commands, manipulating entities, or needing exact API signatures. Covers AutoCAD 2025 and 2026 (both net8.0) with patterns, gotchas, and full API index. TRIGGER when: code references Autodesk.AutoCAD namespaces, imports acdbmgd/acmgd/accoremgd, uses [CommandMethod], or user asks about AutoCAD .NET development.

autocaddotnetplugin-dev
Compatible agents:
  • Claude Code

View on GitHubmaster @ f9a567f14 GitHub stars4 forksupdated Mar 29, 2026

Original description (for the agent)

Comprehensive AutoCAD .NET API reference for plugin development. Use when writing AutoCAD .NET plugins, working with ObjectARX managed wrappers, creating commands, manipulating entities, or needing exact API signatures. Covers AutoCAD 2025 and 2026 (both net8.0) with patterns, gotchas, and full API index. TRIGGER when: code references Autodesk.AutoCAD namespaces, imports acdbmgd/acmgd/accoremgd, uses [CommandMethod], or user asks about AutoCAD .NET development.

AutoCAD .NET Development Skill

You have access to a comprehensive AutoCAD .NET API knowledge base with two tiers:

Tier 1: Patterns (How To)

Human-curated guides with production-tested code examples. Check these FIRST when the developer asks "how do I...":

Pattern FileCovers
patterns/transactions.mdTransaction lifecycle, StartTransaction vs StartOpenCloseTransaction, nesting, disposal
patterns/document-database-editor.mdDocument/Database/Editor trio, document locking, active vs background docs
patterns/entity-creation.mdAdding entities to ModelSpace/PaperSpace, ObjectId lifecycle, bulk creation
patterns/entity-modification.mdOpening for write, modifying properties, batch modifications, Overrule
patterns/block-references.mdBlockTable/BlockTableRecord/BlockReference, attributes, nested blocks, cloning
patterns/selection-sets.mdSelection filters, TypedValue arrays, DXF codes, implied selection
patterns/layers-and-properties.mdLayerTable, creating layers, linetypes, ByLayer vs ByBlock
patterns/xdata.mdResultBuffer, RegApp, DXF group codes, read/write roundtrip, size limits
patterns/commands.md[CommandMethod], CommandFlags, [LispFunction], async commands
patterns/events.mdDatabase/Document/Editor events, Idle processing, undo/redo gotcha
patterns/geometry.mdPoint3d, Vector3d, Matrix3d, transforms, coordinate systems, Tolerance
patterns/palettes.mdPaletteSet, WPF hosting, WinForms hosting, docking, state persistence
patterns/cui-customization.mdRibbon API, tabs, panels, buttons, toolbars, command groups
patterns/plotting.mdPlotEngine workflow, PlotSettings, batch plotting, PDF output
patterns/external-references.mdXref attach/detach/reload/bind, XrefGraph, nested xrefs
patterns/file-io.mdReadDwgFile, SaveAs, WblockClone, side database pattern
patterns/jig-and-drawjig.mdEntityJig, DrawJig, Sampler/Update/WorldDraw, placement preview
patterns/tables.mdSymbol tables (TextStyle, DimStyle, Linetype, RegApp, Block, Layer, etc.)
patterns/error-handling.mdWhat throws vs silent fails, ErrorStatus, eLocked recovery
patterns/performance.mdLarge drawing strategies, regen control, progress meters, bulk operations
patterns/migration-2025-to-2026.mdTFM changes, NuGet versions, breaking API changes between versions

Tier 2: API Index (Exact Signatures)

Auto-generated from official Autodesk NuGet SDK documentation. Use when you need exact method signatures, property types, or to discover available members on a class.

  • api/2025/_index.md — Master class listing for AutoCAD 2025 (1,704 types, 12,651 members)
  • api/2026/_index.md — Master class listing for AutoCAD 2026 (1,727 types, 12,957 members)

Key API Files:

  • api/{ver}/DatabaseServices.md — Entities, Database, Transaction (600+ types)
  • api/{ver}/DatabaseServices.Database.md — Database class deep-dive (441+ members)
  • api/{ver}/DatabaseServices.Entity.md — Entity base class (71+ members)
  • api/{ver}/EditorInput.Editor.md — Editor class (114+ members)
  • api/{ver}/Geometry.md — Point3d, Vector3d, Matrix3d, curves
  • api/{ver}/Customization.md — CUI/Ribbon (157 types)

Tier 3: Gotchas (What Docs Don't Tell You)

Hard-won knowledge from production plugin development:

Gotcha FileCovers
gotchas/common-crashes.mdThings that crash AutoCAD with zero error message
gotchas/thread-safety.mdWhat MUST run on the UI thread, async pitfalls
gotchas/document-locking.mdThe #1 source of mysterious failures
gotchas/disposal-leaks.mdObjectId vs DBObject lifetime, transaction scope leaks
gotchas/version-quirks.mdPer-version behavior differences

How To Use This Skill

Step 1: Detect Version

Check the developer's .csproj for AutoCAD version:

  • <PackageReference Include="AutoCAD.NET" Version="25.x" /> → AutoCAD 2025 (net8.0)
  • <PackageReference Include="AutoCAD.NET" Version="25.1.x" /> → AutoCAD 2026 (net8.0)
  • Both 2025 and 2026 use TFM net8.0-windows

Step 2: Route the Question

"How do I [task]?" → Read the relevant pattern file first. It has tested code examples.

"What methods does [class] have?" → Check api/{version}/_index.md to find the class, then read its namespace file or split file for full member listing.

"Why is my plugin crashing/failing?" → Check gotchas first (especially common-crashes.md and document-locking.md), then the relevant pattern file's "Common Mistakes" section.

"How do I migrate from 2025 to 2026?" → Read patterns/migration-2025-to-2026.md.

Step 3: Write Correct Code

When generating AutoCAD .NET code, ALWAYS:

  1. Use transactions for all database operations
  2. Call AddNewlyCreatedDBObject(entity, true) after AppendEntity()
  3. Commit transactions before dispose
  4. Lock documents when modifying from external contexts
  5. Use OpenMode.ForWrite only when actually modifying
  6. Dispose ResultBuffers and other unmanaged resources
  7. Never compare Point3d/Vector3d with == — use IsEqualTo() with Tolerance

Critical Rules

  • Never use Application.DocumentManager.MdiActiveDocument directly — always use a null-safe wrapper
  • Never access entities outside their transaction scope
  • Never modify entities opened with OpenMode.ForRead
  • Always wrap transactions in using statements
  • Always register RegApp before writing XData