# DWG, DXF and SVG ingestion for AI applications (`aileron-tech/dwg-apify`) Actor

Parse DWG, DXF and SVG drawings from URLs into PNG previews, vector SVG pages, readable tiles, every text label with its pixel position (no OCR) and a metadata index, ready for RAG, search and vision models.

- **URL**: https://apify.com/aileron-tech/dwg-apify.md
- **Developed by:** [Aleksei Kudriashov](https://apify.com/aileron-tech) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 drawing processed

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## dwg-apify

**Apify Actor for DWG, DXF and SVG ingestion.** Give it links to DWG, DXF or SVG drawings. Each result includes PNG previews,
vector SVG pages, readable tiles, native text labels with pixel positions, and a metadata
index for RAG, search and vision models.

Download, parsing and caching come from the
[dwg-mcp](https://github.com/aileron-tech/dwg-mcp) service; rendering from
[dwg2png](https://github.com/aileron-tech/dwg2png). This repository is the
Actor around them.

### Use on Apify

Open the [Actor in the Apify Store](https://apify.com/aileron-tech/dwg-apify), enter drawing URLs, and start a run. For use from an AI client, connect through the Apify MCP server.

#### Client setup

Use this Actor-specific server URL. Select Streamable HTTP and OAuth in
clients that ask for a transport and authentication method, then sign in to Apify.

```text
https://mcp.apify.com/?tools=actors,docs,aileron-tech/dwg-apify
```

| Client | Setup |
|--------|-------|
| General | Add the URL as a remote MCP server and complete Apify sign-in. [Apify MCP setup](https://docs.apify.com/mcp) |
| ChatGPT | Enable developer mode if required, create a custom MCP app, and enter the URL with OAuth. [ChatGPT guide](https://docs.apify.com/integrations/chatgpt) |
| Claude | In **Customize > Connectors**, add a custom connector with the URL. [Claude guide](https://docs.apify.com/integrations/claude-ai) |
| Claude Desktop | Add the URL under **Customize > Connectors** as a remote connector. [Claude Desktop guide](https://docs.apify.com/integrations/claude-desktop) |
| Claude Code | Run the command below, then use `/mcp` to connect and sign in. [Claude Code guide](https://code.claude.com/docs/en/mcp) |
| Codex | Run the command below or add the URL as a remote MCP server in the app. [Codex CLI guide](https://docs.apify.com/integrations/codex-cli) and [Codex app guide](https://docs.apify.com/integrations/codex-app) |
| Cursor | Add a remote MCP server in Cursor settings and use the URL. [Cursor guide](https://docs.apify.com/integrations/cursor) |
| OpenCode | Merge the example below into `opencode.json`. [OpenCode guide](https://docs.apify.com/integrations/opencode) |
| VS Code | Merge the example below into `.vscode/mcp.json`, then start the server and sign in when prompted. [VS Code guide](https://docs.apify.com/integrations/vscode) |

**Claude Code**

```sh
claude mcp add --transport http dwg-apify 'https://mcp.apify.com/?tools=actors,docs,aileron-tech/dwg-apify'
```

**Codex CLI**

```sh
codex mcp add dwg-apify --url 'https://mcp.apify.com/?tools=actors,docs,aileron-tech/dwg-apify'
codex mcp login dwg-apify
```

**OpenCode**

```json
{
  "mcp": {
    "dwg-apify": {
      "type": "remote",
      "url": "https://mcp.apify.com/?tools=actors,docs,aileron-tech/dwg-apify"
    }
  }
}
```

If OpenCode prompts for authentication, run `opencode mcp auth dwg-apify`.

**VS Code**

```json
{
  "servers": {
    "dwg-apify": {
      "type": "http",
      "url": "https://mcp.apify.com/?tools=actors,docs,aileron-tech/dwg-apify"
    }
  }
}
```

For more clients, use the Apify guide for
[Antigravity](https://docs.apify.com/integrations/antigravity),
[DeepSeek Harness](https://docs.apify.com/integrations/deepseek-harness),
[GitHub Copilot](https://docs.apify.com/integrations/github-copilot),
[Grok Bot](https://docs.apify.com/integrations/grok-bot),
[Grok Build](https://docs.apify.com/integrations/grok-build),
[Hermes Agent](https://docs.apify.com/integrations/hermes-agent),
[Kimi Code CLI](https://docs.apify.com/integrations/kimi-code-cli),
[Lovable](https://docs.apify.com/integrations/lovable),
[Manus](https://docs.apify.com/integrations/manus),
[OpenClaw](https://docs.apify.com/integrations/openclaw), or
[Qoder and Qwen](https://docs.apify.com/integrations/alibaba).
Use the Actor-specific URL in clients that accept a custom server URL.
[Apify's integration directory](https://docs.apify.com/integrations/agents)
lists current options.

Try this prompt after connecting.

> Use dwg-apify to parse https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables\_-\_imperial.dwg and report the page count and the number of native text labels.

### Input

| Field | Type | Default | Meaning |
|-------|------|---------|---------|
| `urls` | list of strings | required | http or https links to `.dwg`, `.dxf` or `.svg` files, up to 100 MB each, at most 1000 per run |
| `size` | integer | 3000 | Long edge of each page image in pixels, 512 to 12000 |
| `tiles` | boolean | true | Also cut every page larger than 1500 px into readable tiles |

```json
{ "urls": ["https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables_-_imperial.dwg"], "size": 3000, "tiles": true }
```

### Output

**Dataset:** one item per input URL, in input order.

```json
{
  "url": "https://example.com/drawings/site-plan.dwg",
  "status": "completed",
  "file_name": "site-plan.dwg",
  "sha256": "a8dbe3a6...",
  "cached": false,
  "event": "drawing-parsed",
  "cost_units": 1.0,
  "summary": { "page_count": 2, "label_count": 8, "layers": ["0", "PIPES", "WALLS"], "...": "..." },
  "index_url": "https://api.apify.com/v2/key-value-stores/<store>/records/d000.index.json",
  "pages": [
    {
      "index": 0, "name": "Model", "width": 3000, "height": 2250, "label_count": 6,
      "image_url": ".../records/d000-p00.png",
      "svg_url": ".../records/d000-p00.svg",
      "labels_url": ".../records/d000-p00.labels.json",
      "tiles_url": ".../records/d000-p00.tiles.json",
      "tiles": [{ "row": 0, "col": 0, "image_url": ".../records/d000-p00-r0c0.png" }]
    }
  ]
}
```

A drawing that cannot be fetched or parsed is an item with `"status": "failed"`
and an `error` (`code`, `message`); the run continues with the next URL. Codes:
`download_failed`, `unsupported_file`, `too_large`, `parse_failed`.

**Key-value store:** the files the items link to. `dNNN` is the position of the
drawing in the input, `pNN` the page (0 is Model space).

| Key | Content |
|-----|---------|
| `dNNN-pNN.png` | PNG preview |
| `dNNN-pNN.svg` | vector page |
| `dNNN-pNN.labels.json` | every label of the page: exact text, pixel position, layer, color |
| `dNNN-pNN.tiles.json` | tile grid with the labels inside each tile |
| `dNNN-pNN-rRcC.png` | one tile |
| `dNNN.index.json` | layers, blocks, layouts, entity counts, title-block attributes |
| `OUTPUT` | totals of the run: drawings, parsed, cached, failed, cost units, refused charges |

### Pricing events

The Actor charges per successfully processed drawing. The price depends on
whether the drawing was parsed or served from the run's cache.

| Event | Charged | Price per drawing | Price per 1,000 |
|-------|---------|-------------------|-----------------|
| `drawing-parsed` | Each drawing that was parsed | $0.007 | $7 |
| `drawing-cached` | Each cache hit within the same run | $0.003 | $3 |

Failed drawings are free. Each drawing is charged after its files and dataset
item are saved. [Current Apify Store pricing](https://apify.com/aileron-tech/dwg-apify/pricing)

### Run it

On Apify: push this repository as an Actor (`apify push`, or connect the Git
repository in Apify Console). The build needs to read the `dwg-mcp` and
`dwg2png` repositories.

Natively, as an Actor would be started (the environment is what Apify sets):

```sh
cargo install --git https://github.com/aileron-tech/dwg-apify
dwg-apify --help
```

With [dwg2png](https://github.com/aileron-tech/dwg2png) installed too,
`dwg2png --apify` starts the same program.

### Limits of this version

- The cache lives inside one run: a URL or a drawing repeated in the input is a
  cache hit, but nothing is kept between runs.
- To bound the number of drawing charges, limit the URLs in a run.

### Tests

```sh
cargo test --release
```

22 end-to-end tests run the built `dwg-apify` binary against a local stand-in
for the Apify API (input record, key-value store, dataset, charge endpoint) and
a local file server; 5 unit tests cover the pure rules. Each test carries a
`REQ-APIFY-<id>` requirement comment.

### License

MPL-2.0

# Actor input Schema

## `urls` (type: `array`):

http or https links to .dwg, .dxf or .svg files, up to 100 MB each and at most 1000 per run. The file name comes from the link or from the Content-Disposition header and must end in .dwg, .dxf or .svg.

## `size` (type: `integer`):

Long edge of each page image in pixels. Larger images keep small labels readable and take more storage.

## `tiles` (type: `boolean`):

Also cut every page larger than 1500 px into readable tiles for vision models, each with the labels inside it.

## Actor input object example

```json
{
  "urls": [
    "https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables_-_imperial.dwg"
  ],
  "size": 3000,
  "tiles": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables_-_imperial.dwg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aileron-tech/dwg-apify").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables_-_imperial.dwg"] }

# Run the Actor and wait for it to finish
run = client.actor("aileron-tech/dwg-apify").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://download.autodesk.com/us/samplefiles/acad/blocks_and_tables_-_imperial.dwg"
  ]
}' |
apify call aileron-tech/dwg-apify --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aileron-tech/dwg-apify"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oOZzuVuTU5iNqiAIV/builds/VRxMsvOSeZUnx8XTM/openapi.json
