How to Build a Civil 3D Plugin with Claude Code Without Being a Programmer: End-to-End 2026 Guide
How to build a Civil 3D plugin with Claude Code without coding experience: architecture, prompts that work, and how to compile and deploy it.
Vibe Coding for BIM · Claude Code + Civil 3D
Building your first Civil 3D plugin used to take weeks. With Claude Code and this architecture, it takes a weekend.
This isn't magic. It's method. This guide takes you from 'I've never opened Visual Studio' to a .bundle ready to install on your boss's machine — with an architecture that scales from day one.
First things first: why a plugin and not just a Dynamo script
Dynamo is great for prototypes and personal use. But when you want to share the automation with your coworkers, have your own button in the Civil 3D toolbar, and have it work without opening the visual editor, you need a native C# plugin. If you're still torn between Dynamo and C#, read Dynamo vs. C# in Civil 3D and Revit first.
A C# plugin gets you:
- A visible button with an icon in the Civil 3D toolbar (the tab strip where "Home," "Insert," etc. live).
- Native performance — it processes thousands of objects in seconds.
- An installer to roll out to your whole team.
- Controlled updates.
- Code you can version in Git and maintain over time.
And with Claude Code: you no longer need to master C# or the Civil 3D API to do it. You need method.
The path you'll follow in this guide
Setup
30 min
Project with Claude Code
10 min
Architecture
Solid foundation
First command
1 hr
Distributable .bundle
Installable
From civil engineer to plugin author, in 10 steps
An end-to-end overview with Claude Code: from understanding the terms to handing the end user an installer. Simple, scalable architecture, explained without jargon.
- 00Basics
Context — 10 terms you need to know
A plain-language glossary before you start (API, SDK, DLL, etc.)
- 01Context
What a Civil 3D plugin is
What you can automate and what you can't
- 02Setup
Prerequisites (30 min)
Free programs you need to install
- 03Start
Creating the project with Claude Code
A real step-by-step, the initial prompt that works
- 04Design
The recommended architecture
3 simple layers that make your plugin scalable
- 05Prompt
How to talk to Claude Code
Clear messages, constraints, and step-by-step verification
- 06First plugin
Your first working command
'Hello Civil 3D' — lists every alignment in the drawing
- 07UI
Adding a button to the toolbar
From a keyboard command to a visible button with an icon
- 08Build
Packaging as a bundle
Autodesk's official format for install-ready plugins
- 09Delivery
Distributing to end users
Installer, versions, updates
Before you start, here are the words you'll see throughout the rest of the article, explained in plain language. Read them now and you won't have to Google anything later.
1. Plugin (or "extension") — a small file that adds new buttons and functions to a program you already use. Like a Chrome extension, but for Civil 3D.
2. API — the official list of things a program lets you do to it from the outside. Think of a restaurant menu: the Civil 3D API is "the menu" of what you can ask it to do through code. If it's not on the menu (the API), you can't order it.
3. SDK — the "developer toolkit." An official package you download that contains the files your code needs to talk to Civil 3D.
4. DLL — the final file your plugin produces. It's like an .exe, but one that another program (Civil 3D) loads inside itself. When we say "compile the DLL," we mean "generate the final file."
5. Bundle — a folder with a special structure that Civil 3D automatically recognizes on startup. It's the "professional" way to deliver your plugin — a single folder you copy over and you're done.
6. Compile — the step that converts your code (text) into an installable file (.dll). Like printing a document: the Word file (code) becomes a PDF (final file).
7. Visual Studio — the editor where you write code. It's a free Microsoft application. Don't be intimidated by how heavy it looks when it opens — you'll use maybe 5% of its features.
8. .NET Framework — the "version" of the Windows runtime your plugin runs on. Civil 3D requires a specific version (for example 4.8 or 8) — you just need to match it once and you're set.
9. Git — the system that keeps a history of your code. Every time something works, you make a "commit" (a checkpoint) and you can always go back to it. It's your infinite backup — a beginner's best friend.
10. Claude Code — Anthropic's tool that writes code for you from your terminal. You talk to it in plain English, it understands your project, and it proposes what to write. You confirm, and it applies the changes.
A Civil 3D plugin is a .dll file compiled in .NET that Civil 3D loads on startup. It adds commands, buttons, windows, and panels that didn't ship out of the box.
What you can do:
- Loop through every object in the drawing (alignments, surfaces, profiles, corridors, etc.).
- Read and modify their properties.
- Create new objects programmatically.
- Export data to Excel, CSV, JSON.
- Automate command sequences.
- Add your own window with forms.
- Listen to events (when the user creates/modifies/deletes something).
What you can't do:
- Change the internal behavior of official commands.
- Access parts of the API that Autodesk doesn't expose.
- Run outside the Civil 3D process.
- Run on Mac or Linux (the API is Windows only).
Examples of real, useful plugins:
- A quantity takeoff exporter with your firm's own format.
- A bulk alignment renamer that follows a naming standard.
- An automatic generator of longitudinal profiles every X meters.
- A drawing standards checker (naming conventions, allowed layers).
- A report of classified survey points exported to CSV.
What you need installed before writing a single line:
- Windows 10/11 with Civil 3D installed (whichever version you use at work).
- Visual Studio Community 2022 (free) — visualstudio.microsoft.com. During installation, check the ".NET desktop development" workload.
- Civil 3D SDK — download it from Autodesk's developer portal. Search for
"Civil 3D <your version> SDK". Installing it registers the DLLs you'll need to reference. - A claude.ai account (Pro plan recommended for long coding sessions).
- Claude Code — install it via terminal with
npm install -g @anthropic-ai/claude-code(requires Node.js). - Git — git-scm.com, or GitHub Desktop if you prefer a visual interface.
Verify everything is working:
# In a terminal:
dotnet --version # should show 6.0 or higher
claude --version # should show your Claude Code version
git --version # any modern version
Step 1 — Open a terminal in your projects folder:
cd C:\Dev\CivilPlugins
mkdir MyFirstC3DPlugin
cd MyFirstC3DPlugin
Step 2 — Launch Claude Code:
claude
The interactive session opens. Now you'll give it the initial prompt. This prompt is the cornerstone of everything that follows:
Act as a senior .NET plugin architect for Autodesk Civil 3D.
Context:
- I'm building my FIRST Civil 3D plugin.
- I'm using Civil 3D 2025 (.NET 8).
- I'm on Windows with Visual Studio 2022 installed.
- Civil 3D SDK installed at C:\Program Files\Autodesk\Civil 3D 2025\
- The plugin will be called "ZeistTools" and its root namespace will be "ZeistTools".
Goal:
Create the initial project structure following the
Command → Service → Repository architecture that I'll describe in
the next message. Do NOT generate functional code yet — only:
1. The .csproj file with the necessary references to AcCoreMgd,
AcDbMgd, AcMgd (AutoCAD) and AeccDbMgd (Civil 3D).
2. A README.md describing the project.
3. A proper .gitignore for .NET Framework + Visual Studio projects.
4. The empty folder structure:
- Commands/
- Services/
- Repositories/
- Models/
- UI/
- Resources/
Before creating anything, show me the plan and ask for confirmation.
Step 3 — Claude Code shows its plan. Read it. If something doesn't add up, ask it to adjust. Once you confirm, it creates the files.
Step 4 — Verify:
ls # you should see .csproj, README.md, .gitignore, and the folders
Step 5 — First commit:
git init
git add .
git commit -m "Initial project structure"
This is the most important module in the article. Getting the architecture right from the start saves you weeks of pain down the road.
The recommended architecture: Command → Service → Repository
The plugin's 3 layers
Command
Entry point
Service
Business logic
Repository
Access to the Civil 3D API
Translated into folders and responsibilities:
ZeistTools/
├── Commands/ → entry point (what Civil 3D executes)
│ └── ExportAlignmentsCommand.cs
├── Services/ → business logic (your rules)
│ └── AlignmentExportService.cs
├── Repositories/ → talks to the Civil 3D API
│ └── AlignmentRepository.cs
├── Models/ → plain data objects
│ └── AlignmentInfo.cs
├── UI/ → windows, forms (optional)
│ └── ExportOptionsWindow.xaml
├── Resources/ → icons, images, text
│ └── icons/
└── ZeistTools.csproj
The golden rule for each layer:
- Command: only orchestrates. It receives the event from Civil 3D, delegates to the Service, and shows the result to the user. It never touches the API directly.
- Service: contains YOUR logic ("alignments shorter than 100m don't count," "the CSV needs this header"). It knows nothing about Civil 3D — it works with
Models. - Repository: the only layer that knows the Civil 3D API. It translates between Civil 3D objects and your
Models.
Concrete advantages of this separation:
- Testable. You can test the Service without opening Civil 3D — just simulate data in Models.
- Upgradable. When Autodesk changes the API in the next version (and it always happens), you only touch the Repository. Service and Command stay untouched.
- Reusable. The same Service can have one Command for Civil 3D and another for AutoCAD Map, each with its own Repository.
- Scalable. Adding a new command means: 1 new Command + reusing existing Services.
- Debuggable. When something breaks, you know exactly which layer to check.
The antipattern you'll see in old tutorials:
A single giant Class1.cs file with a [CommandMethod] that does EVERYTHING: calls the API, calculates, formats, shows a window. Never do this. It's fast at first and a nightmare three months later.
Claude Code works 10x better with structured prompts. Here are the patterns I use.
Pattern 1 — Adding a new feature:
Add a new command "ExportAlignmentsToCsv" following the project's
architecture. Requirements:
- Command in Commands/ExportAlignmentsToCsvCommand.cs
- Registers with [CommandMethod("ZEIST_EXPORT_ALIGN_CSV")]
- Shows the user how many alignments were exported and where
- Service in Services/AlignmentExportService.cs
- Method ExportToCsv(IEnumerable<AlignmentInfo>, string path)
- CSV header: Name, StartStation, EndStation, Length, Layer
- Skips alignments whose Length is less than 100
- Repository in Repositories/AlignmentRepository.cs
- Method GetAllAlignments() : IEnumerable<AlignmentInfo>
- Must read from the active Civil 3D document
- Model in Models/AlignmentInfo.cs with the 5 properties
Rules:
- Do NOT modify files outside those 4 paths.
- Do NOT add new NuGet dependencies.
- Follow the code style of the existing files.
- At the end, list the files you created/modified
and explain in 2 lines what each one does.
Pattern 2 — Debugging an error:
I get this error when compiling:
[paste the EXACT error with line number]
Step-by-step diagnosis:
1. Explain what the error means.
2. Identify which layer it's in.
3. Propose the simplest possible fix (don't refactor anything else).
4. Show it to me before applying it, so I can confirm.
Pattern 3 — Asking for an explanation:
Explain in plain language what this block of code does:
[paste the code]
Specifically:
- What is a "Transaction" and why is it used?
- What happens if I don't call .Commit()?
- Does this code work with multiple open documents?
Important rules when using Claude Code:
- Always give explicit context. Civil 3D version, .NET framework, architecture. Don't make it guess.
- Small steps. One command per session. Don't ask for "10 commands at once."
- Verify before confirming. Read the changes before it applies them.
- Commit often. After every change that works.
- Don't lose an important session — Claude Code keeps the history in the project, but export the important lessons to markdown too.
The classic "Hello World," adapted to Civil 3D: list every alignment in the active drawing in the command window.
Prompt for Claude Code:
Create the plugin's first working command following the architecture
we already set up. The command:
- Is called "ZEIST_LIST_ALIGN".
- When run, it shows in the Civil 3D command window
the list of all alignments in the active drawing, with their name
and length.
- If there are no alignments, it shows "No alignments in the drawing".
- Error handling: if something fails, show a useful message instead
of a raw stack trace.
Follow the Command → Service → Repository architecture:
- ListAlignmentsCommand delegates to AlignmentQueryService.
- AlignmentQueryService returns a List<AlignmentInfo> from AlignmentRepository.
- AlignmentRepository is the only one that touches the Civil 3D API.
When you're done, give me instructions to:
1. Compile (Debug config).
2. Load it into Civil 3D with NETLOAD.
3. Run the command and see the result.
What to expect: Claude Code will create about 4-5 files. Review them. Compile with Ctrl+Shift+B in Visual Studio or dotnet build in the terminal.
Loading it into Civil 3D:
- Open Civil 3D.
- Run the
NETLOADcommand. - Select the
bin\Debug\ZeistTools.dllfile. - Run
ZEIST_LIST_ALIGN. - If your drawing has alignments, you'll see the list. If not, draw an alignment first.
By this point you're officially a Civil 3D plugin developer. Everything else is adding more commands following the same pattern.
A command you type by keyboard works, but a visible button with an icon in the toolbar is what actually gets your coworkers to use it, since they won't have to remember the command name.
We're talking about the top strip in Civil 3D where the "Home," "Insert," "Annotate," etc. tabs already live. We'll add our own tab there called "Zeist" with our buttons.
Message for Claude Code:
Add a button to the Civil 3D toolbar that runs the
ZEIST_LIST_ALIGN command. Requirements:
- It registers automatically when the plugin loads (use the
IExtensionApplication.Initialize interface — Claude Code will know
what that is).
- Creates a new "Zeist" tab in the toolbar if it doesn't exist yet.
- Inside it, an "Alignments" panel with a "List alignments" button.
- The button uses a 32x32 pixel PNG icon that I'll place at
Resources/icons/list-align.png (you don't need to create the
icon, just reference it — if it doesn't exist, leave the code
ready with a TODO to add it later).
- The button's text should default to English.
Also tell me:
- Where I should place the icon file.
- What configuration line makes the icon get copied alongside
the plugin when compiled.
Follow the architecture: the button logic lives in UI/RibbonBuilder.cs
(Autodesk internally calls this bar the "ribbon" — that's where the
name comes from), which only delegates to the existing Command.
Afterward:
- Download or draw a simple 32×32 pixel icon in PNG format. You can use Icons8 (a free icon library) or create one in Figma.
- Place it at
Resources/icons/list-align.png. - Compile (the final
.dllfile). - Reload it in Civil 3D (run
NETLOADand pick the new.dll). - You should see the new "Zeist" tab in the toolbar, with your button inside.
Your .dll works fine with manual NETLOAD. But to distribute it professionally, Autodesk has an official format: the bundle. It's a folder with a specific structure that Civil 3D loads automatically on startup.
Structure of a bundle:
ZeistTools.bundle/
├── PackageContents.xml
└── Contents/
├── Windows/
│ └── ZeistTools.dll (your plugin compiled in Release)
└── Resources/
└── icons/
└── list-align.png
Prompt for Claude Code:
Create the bundle structure and the PackageContents.xml file to
distribute the plugin as ZeistTools.bundle.
Requirements:
- Compatible with Civil 3D 2024 and 2025.
- Publisher: "Zeist" (this is what shows in the add-in manager).
- Version: 1.0.0.
- Bilingual description (EN/ES): "Zeist Tools for Civil 3D".
- Autoload when Civil 3D starts.
- Must load ZeistTools.dll from Contents/Windows.
Also, add a build.ps1 (PowerShell) script that:
1. Compiles the project in Release.
2. Copies the .dll and resources into the bundle structure.
3. Produces the finished .bundle, ready to distribute.
Explain the contents of PackageContents.xml line by line.
Afterward:
- Run
./build.ps1from the terminal (orbuild.shif you're on WSL). - The script leaves
ZeistTools.bundle/ready to go. - Copy it to:
%APPDATA%\Autodesk\ApplicationPlugins\(single user) or%PROGRAMDATA%\Autodesk\ApplicationPlugins\(system-wide). - Restart Civil 3D. It loads automatically.
Level 1 — Manual distribution (small teams, 1-5 users):
- Zip the
.bundleand send it by email/Drive. - A 3-line install manual:
- Unzip into
%APPDATA%\Autodesk\ApplicationPlugins\ - Restart Civil 3D
- The "Zeist" tab appears in the Civil 3D toolbar
- Unzip into
Level 2 — Installer with Inno Setup (medium teams, 10-50 users):
Inno Setup is a free tool for building .exe installers.
Create an Inno Setup script (installer.iss) that:
- Installs the bundle in Autodesk's standard path.
- Creates a Start Menu icon for "Zeist Tools".
- Includes an uninstaller.
- Requests elevated privileges to install system-wide.
- Shows a license and description before installing.
You compile it and get ZeistToolsSetup.exe — an installer anyone can run.
Level 3 — Distribution with automatic updates (enterprise, >50 users):
This is where it gets serious: you need a server that hosts new versions, and your plugin needs to check on startup whether a new version exists. Options:
- Squirrel.Windows — a .NET framework for Chrome/Slack-style auto-updates.
- WiX Toolset — enterprise
.msiinstallers with update support. - Internal distribution via SCCM or Autodesk Vault — if your company already uses one of these.
Level 4 — Publishing on the Autodesk App Store:
If you want to monetize or distribute to external clients, the Autodesk App Store is the official marketplace. It requires:
- Registering as a publisher.
- Passing the review process (code, documentation, screenshots).
- A digital signature on the
.dll.
Start at Level 1 and move up as demand grows.
Comparison: learning solo vs. with Claude Code vs. mentoring
| Criterion | Learning solo (2020) | With Claude Code (2026) |
|---|---|---|
| Time to first working plugin | 2-6 weeks | A weekend |
| Need to know C# in depth | High | Moderate (you learn as you go) |
| Need to read 200 pages of API docs | Yes | No (Claude already knows them) |
| Debugging weird errors | Hours in forums | Minutes with AI |
| Correct architecture from the start | Hard without experience | AI proposes it and respects it |
| Financial cost | Zero + your time | Claude Pro + your time |
| Distribution to end users | Trial and error | Step-by-step guide |
Resources and next steps
📘 Pillar guide: the full picture of this topic lives in Building add-ins for Revit and Civil 3D: the complete guide.
- If you've never programmed before, pair this with Learn to Code From Scratch for the fundamentals.
- If you're torn between this route and staying with Dynamo, read Dynamo vs. C# in Civil 3D and Revit.
- If you want to understand the code the AI writes, the foundation is in Civil 3D API in C#, getting started.
- For more context on AI-driven BIM development, see Dynamo and C# Plugins with AI (Claude).
- For the general framework of good practices, see Programming for Civil Engineers.
- Official documentation: Civil 3D .NET API Reference and Autodesk Developer Network.
- What AI already ships with the software and what it can't do: AI for AutoCAD and Civil 3D in 2026.
Frequently asked questions about Civil 3D plugins with AI
Yes, with caveats. You can build simple, useful plugins (exporting data, renaming objects, generating reports, automating repetitive tasks) by following this guide + Claude Code + an afternoon. What you CAN'T do is design the architecture for a complex system, or distribute it to 500 users with automatic updates, without help. For the first case, AI + minimal fundamentals are enough. For the second, you need a developer.
Found this useful? Share it with that civil engineer who "always wanted to automate" but thinks they need to know C#. Not anymore. And if you want help with your first real plugin, reach out — the first call is free.
Keep reading on this topic
Revit and Civil 3D Add-in Development: The Complete Guide (2026)
The complete guide to Revit and Civil 3D add-in development: what add-ins are, what to automate, C# and the Autodesk API, deployment and cost.
Dynamo and C# plugins for Civil 3D and Revit with AI: how to build them 10x faster with Claude
How AI (Claude, ChatGPT) speeds up Dynamo scripts and C# plugin development for Civil 3D and Revit, and what an engineer needs to know to use it well.
Dynamo vs C# in Civil 3D and Revit: when to use each + automations that save hours
Dynamo or C# for automating Civil 3D and Revit: the real differences, when each one is worth it, and automations that save hours, with examples.
How much does a Revit or Civil 3D add-in cost? 2026 pricing and timeline guide
How much a Revit or Civil 3D add-in costs to build: what drives price and timeline, and how to calculate whether it pays for itself in hours saved.