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 File |
Covers |
patterns/transactions.md |
Transaction lifecycle, StartTransaction vs StartOpenCloseTransaction, nesting, disposal |
patterns/document-database-editor.md |
Document/Database/Editor trio, document locking, active vs background docs |
patterns/entity-creation.md |
Adding entities to ModelSpace/PaperSpace, ObjectId lifecycle, bulk creation |
patterns/entity-modification.md |
Opening for write, modifying properties, batch modifications, Overrule |
patterns/block-references.md |
BlockTable/BlockTableRecord/BlockReference, attributes, nested blocks, cloning |
patterns/selection-sets.md |
Selection filters, TypedValue arrays, DXF codes, implied selection |
patterns/layers-and-properties.md |
LayerTable, creating layers, linetypes, ByLayer vs ByBlock |
patterns/xdata.md |
ResultBuffer, RegApp, DXF group codes, read/write roundtrip, size limits |
patterns/commands.md |
[CommandMethod], CommandFlags, [LispFunction], async commands |
patterns/events.md |
Database/Document/Editor events, Idle processing, undo/redo gotcha |
patterns/geometry.md |
Point3d, Vector3d, Matrix3d, transforms, coordinate systems, Tolerance |
patterns/palettes.md |
PaletteSet, WPF hosting, WinForms hosting, docking, state persistence |
patterns/cui-customization.md |
Ribbon API, tabs, panels, buttons, toolbars, command groups |
patterns/plotting.md |
PlotEngine workflow, PlotSettings, batch plotting, PDF output |
patterns/external-references.md |
Xref attach/detach/reload/bind, XrefGraph, nested xrefs |
patterns/file-io.md |
ReadDwgFile, SaveAs, WblockClone, side database pattern |
patterns/jig-and-drawjig.md |
EntityJig, DrawJig, Sampler/Update/WorldDraw, placement preview |
patterns/tables.md |
Symbol tables (TextStyle, DimStyle, Linetype, RegApp, Block, Layer, etc.) |
patterns/error-handling.md |
What throws vs silent fails, ErrorStatus, eLocked recovery |
patterns/performance.md |
Large drawing strategies, regen control, progress meters, bulk operations |
patterns/migration-2025-to-2026.md |
TFM 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 File |
Covers |
gotchas/common-crashes.md |
Things that crash AutoCAD with zero error message |
gotchas/thread-safety.md |
What MUST run on the UI thread, async pitfalls |
gotchas/document-locking.md |
The #1 source of mysterious failures |
gotchas/disposal-leaks.md |
ObjectId vs DBObject lifetime, transaction scope leaks |
gotchas/version-quirks.md |
Per-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:
- Use transactions for all database operations
- Call
AddNewlyCreatedDBObject(entity, true) after AppendEntity()
- Commit transactions before dispose
- Lock documents when modifying from external contexts
- Use
OpenMode.ForWrite only when actually modifying
- Dispose ResultBuffers and other unmanaged resources
- 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
1---2name: autocad-dotnet3description: 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.4---56# AutoCAD .NET Development Skill78You have access to a comprehensive AutoCAD .NET API knowledge base with two tiers:910## Tier 1: Patterns (How To)1112Human-curated guides with production-tested code examples. **Check these FIRST** when the developer asks "how do I...":1314| Pattern File | Covers |15|---|---|16| `patterns/transactions.md` | Transaction lifecycle, StartTransaction vs StartOpenCloseTransaction, nesting, disposal |17| `patterns/document-database-editor.md` | Document/Database/Editor trio, document locking, active vs background docs |18| `patterns/entity-creation.md` | Adding entities to ModelSpace/PaperSpace, ObjectId lifecycle, bulk creation |19| `patterns/entity-modification.md` | Opening for write, modifying properties, batch modifications, Overrule |20| `patterns/block-references.md` | BlockTable/BlockTableRecord/BlockReference, attributes, nested blocks, cloning |21| `patterns/selection-sets.md` | Selection filters, TypedValue arrays, DXF codes, implied selection |22| `patterns/layers-and-properties.md` | LayerTable, creating layers, linetypes, ByLayer vs ByBlock |23| `patterns/xdata.md` | ResultBuffer, RegApp, DXF group codes, read/write roundtrip, size limits |24| `patterns/commands.md` | [CommandMethod], CommandFlags, [LispFunction], async commands |25| `patterns/events.md` | Database/Document/Editor events, Idle processing, undo/redo gotcha |26| `patterns/geometry.md` | Point3d, Vector3d, Matrix3d, transforms, coordinate systems, Tolerance |27| `patterns/palettes.md` | PaletteSet, WPF hosting, WinForms hosting, docking, state persistence |28| `patterns/cui-customization.md` | Ribbon API, tabs, panels, buttons, toolbars, command groups |29| `patterns/plotting.md` | PlotEngine workflow, PlotSettings, batch plotting, PDF output |30| `patterns/external-references.md` | Xref attach/detach/reload/bind, XrefGraph, nested xrefs |31| `patterns/file-io.md` | ReadDwgFile, SaveAs, WblockClone, side database pattern |32| `patterns/jig-and-drawjig.md` | EntityJig, DrawJig, Sampler/Update/WorldDraw, placement preview |33| `patterns/tables.md` | Symbol tables (TextStyle, DimStyle, Linetype, RegApp, Block, Layer, etc.) |34| `patterns/error-handling.md` | What throws vs silent fails, ErrorStatus, eLocked recovery |35| `patterns/performance.md` | Large drawing strategies, regen control, progress meters, bulk operations |36| `patterns/migration-2025-to-2026.md` | TFM changes, NuGet versions, breaking API changes between versions |3738## Tier 2: API Index (Exact Signatures)3940Auto-generated from official Autodesk NuGet SDK documentation. **Use when you need exact method signatures, property types, or to discover available members on a class.**4142- `api/2025/_index.md` — Master class listing for AutoCAD 2025 (1,704 types, 12,651 members)43- `api/2026/_index.md` — Master class listing for AutoCAD 2026 (1,727 types, 12,957 members)4445### Key API Files:46- `api/{ver}/DatabaseServices.md` — Entities, Database, Transaction (600+ types)47- `api/{ver}/DatabaseServices.Database.md` — Database class deep-dive (441+ members)48- `api/{ver}/DatabaseServices.Entity.md` — Entity base class (71+ members)49- `api/{ver}/EditorInput.Editor.md` — Editor class (114+ members)50- `api/{ver}/Geometry.md` — Point3d, Vector3d, Matrix3d, curves51- `api/{ver}/Customization.md` — CUI/Ribbon (157 types)5253## Tier 3: Gotchas (What Docs Don't Tell You)5455Hard-won knowledge from production plugin development:5657| Gotcha File | Covers |58|---|---|59| `gotchas/common-crashes.md` | Things that crash AutoCAD with zero error message |60| `gotchas/thread-safety.md` | What MUST run on the UI thread, async pitfalls |61| `gotchas/document-locking.md` | The #1 source of mysterious failures |62| `gotchas/disposal-leaks.md` | ObjectId vs DBObject lifetime, transaction scope leaks |63| `gotchas/version-quirks.md` | Per-version behavior differences |6465## How To Use This Skill6667### Step 1: Detect Version68Check the developer's `.csproj` for AutoCAD version:69- `<PackageReference Include="AutoCAD.NET" Version="25.x" />` → AutoCAD 2025 (net8.0)70- `<PackageReference Include="AutoCAD.NET" Version="25.1.x" />` → AutoCAD 2026 (net8.0)71- Both 2025 and 2026 use TFM `net8.0-windows`7273### Step 2: Route the Question7475**"How do I [task]?"** → Read the relevant pattern file first. It has tested code examples.7677**"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.7879**"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.8081**"How do I migrate from 2025 to 2026?"** → Read `patterns/migration-2025-to-2026.md`.8283### Step 3: Write Correct Code8485When generating AutoCAD .NET code, ALWAYS:861. Use transactions for all database operations872. Call `AddNewlyCreatedDBObject(entity, true)` after `AppendEntity()`883. Commit transactions before dispose894. Lock documents when modifying from external contexts905. Use `OpenMode.ForWrite` only when actually modifying916. Dispose ResultBuffers and other unmanaged resources927. Never compare Point3d/Vector3d with `==` — use `IsEqualTo()` with `Tolerance`9394### Critical Rules95- **Never** use `Application.DocumentManager.MdiActiveDocument` directly — always use a null-safe wrapper96- **Never** access entities outside their transaction scope97- **Never** modify entities opened with `OpenMode.ForRead`98- **Always** wrap transactions in `using` statements99- **Always** register RegApp before writing XData