# 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,…

- **Type:** Skill
- **Install:** `agentstack add skill-joseguiaces-autocad-dotnet-claude-skill-autocad-dotnet`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [joseguiaCES](https://agentstack.voostack.com/s/joseguiaces)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [joseguiaCES](https://github.com/joseguiaCES)
- **Source:** https://github.com/joseguiaCES/autocad-dotnet-claude-skill/tree/master/skills/autocad-dotnet

## Install

```sh
agentstack add skill-joseguiaces-autocad-dotnet-claude-skill-autocad-dotnet
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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:
- `` → AutoCAD 2025 (net8.0)
- `` → 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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [joseguiaCES](https://github.com/joseguiaCES)
- **Source:** [joseguiaCES/autocad-dotnet-claude-skill](https://github.com/joseguiaCES/autocad-dotnet-claude-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-joseguiaces-autocad-dotnet-claude-skill-autocad-dotnet
- Seller: https://agentstack.voostack.com/s/joseguiaces
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
