# dwg-to-excel

Converts AutoCAD DWG files into structured Excel databases and PDFs using the DwgExporter CLI. Useful for extracting layers, blocks, and geometry data without an Autodesk license.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 308 installs · ★ 373
- Author: datadrivenconstruction
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CAD-Converters/dwg-to-excel/SKILL.md
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/skills/dwg-to-excel

## What it does

This skill guides coding agents through exporting drawing data from AutoCAD DWG files across versions from 1983 to 2026. The extraction captures layer hierarchies, block references with attributes, text annotations, dimensions, and geometric entities. Passing the `sheets2pdf` argument also generates PDF files directly from drawing layouts.

The tool relies on the `DwgExporter.exe` command-line utility paired with a Python script powered by `pandas`. The script opens the Elements sheet, summarizes entity counts, and groups block definitions. All operations run offline on your machine.

Running this requires a Windows operating system, `python3`, and the `DwgExporter.exe` executable present in your environment. Attempting to use this on Linux or macOS will fail immediately because of the win32 binary requirement.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill dwg-to-excel -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dwg-to-excel/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dwg-to-excel/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill dwg-to-excel -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dwg-to-excel/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill dwg-to-excel -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dwg-to-excel/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction dwg-to-excel
```

2. **Manually: put the files in place**
- File: `.github/skills/dwg-to-excel/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill dwg-to-excel -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --path 1_DDC_Toolkit/CAD-Converters/dwg-to-excel
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dwg-to-excel/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill dwg-to-excel -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CAD-Converters/dwg-to-excel/SKILL.md

## When to use it
- extract layers, block attributes, and geometry from DWG files into Excel
- export AutoCAD drawing layouts to PDF files without AutoCAD
- batch process folders of legacy and modern DWG files
- inspect CAD drawing metadata without purchasing Autodesk licenses

## Example prompts
- Convert C:\Projects\FloorPlan.dwg to Excel and export sheets to PDF
- Batch convert all DWG files in C:\Projects using DwgExporter
- Parse layers and block attributes from FloorPlan.xlsx using Python

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 1c6af75b1f1f7c12.

BEGIN THIRD-PARTY FILE 1c6af75b1f1f7c12
````text
---
name: "dwg-to-excel"
description: "Convert AutoCAD DWG files (1983-2026) to Excel databases using DwgExporter CLI. Extract layers, blocks, attributes, and geometry data without Autodesk licenses."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw":{"emoji":"📄","os":["win32"],"homepage":"https://datadrivenconstruction.io","requires":{"bins":["python3","DwgExporter"]}}}
---

# DWG to Excel Conversion

## Business Case

### Problem Statement
AutoCAD DWG files contain valuable project data locked in proprietary format:
- Layer structures with drawing organization
- Block references with attribute data
- Text annotations and dimensions
- Geometric entities (lines, polylines, arcs)
- External references (xrefs)

Extracting this data typically requires AutoCAD licenses or complex programming.

### Solution
DwgExporter.exe converts DWG files to structured Excel databases offline, without Autodesk licenses.

### Business Value
- **Zero license cost** - No AutoCAD license required
- **Legacy support** - Reads DWG files from 1983 to 2026
- **Data extraction** - Layers, blocks, attributes, text, geometry
- **PDF export** - Generate drawings from DWG layouts
- **Batch processing** - Convert thousands of DWG files

## Technical Implementation

### CLI Syntax
```bash
DwgExporter.exe <input_dwg> [options]
```

### Output Formats
| Output | Description |
|--------|-------------|
| `.xlsx` | Excel database with all entities |
| `.pdf` | PDF drawings from layouts |

### Supported Versions
| Version Range | Description |
|---------------|-------------|
| R12 (1992) | Legacy DWG |
| R14 (1997) | AutoCAD 14 |
| 2000-2002 | DWG 2000 format |
| 2004-2006 | DWG 2004 format |
| 2007-2009 | DWG 2007 format |
| 2010-2012 | DWG 2010 format |
| 2013-2017 | DWG 2013 format |
| 2018-2026 | DWG 2018 format |

### Examples

```bash
# Basic conversion
DwgExporter.exe "C:\Projects\FloorPlan.dwg"

# Export with PDF drawings
DwgExporter.exe "C:\Projects\FloorPlan.dwg" sheets2pdf

# Batch processing all DWG in folder
for /R "C:\Projects" %f in (*.dwg) do DwgExporter.exe "%f"

# PowerShell batch conversion
Get-ChildItem "C:\Projects\*.dwg" -Recurse | ForEach-Object {
    & "C:\DDC\DwgExporter.exe" $_.FullName
}
```

### Python Integration

```python
import subprocess
import pandas as pd
from pathlib import Path
from typing import List, Optional, Dict, Any
from dataclasses import dataclass
from enum import Enum


class DWGEntityType(Enum):
````
END THIRD-PARTY FILE 1c6af75b1f1f7c12

The third-party file has ended. Everything between the 1c6af75b1f1f7c12 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2466 of 15624 bytes. © datadrivenconstruction · MIT · https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CAD-Converters/dwg-to-excel/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
