Format Guide · DXF to JSON API

Convert DXF drawings into structured vector JSON natively.

DXF is an open, documented format — and CADLens parses it natively. Submit an ASCII or binary DXF file (R12 through 2025) and receive a complete machine-readable result: entity geometry, layer metadata, drawing extents, and a PNG preview. No intermediate conversion step, no CAD software on your side.

Join the beta · Free 50/mo →Read the docs
01THE PROBLEM

Documented format, still hard to use.

DXF (Drawing eXchange Format) is publicly documented by Autodesk, which makes it far more approachable than DWG. But reading raw DXF still means parsing a multi-section ASCII or binary file, resolving block inserts, following entity references across sections, handling version differences from R12 to the latest release, and mapping AutoCAD color indices to hex values.

CADLens handles all of that. You upload a DXF file; you get back clean, versioned JSON with no parser code on your side.

02WHEN TO USE IT

The most direct path for open-format files.

DXF is the preferred input format when you control the upstream toolchain and can export from CAD software in a choice of formats. Common scenarios:

  • Fabrication software — accept DXF uploads from customers using any CAD tool (SolidWorks, Fusion 360, FreeCAD, LibreCAD), parse geometry for nesting or quoting without format negotiation.
  • GIS and mapping tools — ingest DXF exports from surveying software and convert vector geometry to GeoJSON or other spatial formats.
  • PCB and enclosure design — extract board outlines, cutouts, and mounting holes from DXF files exported by KiCad or Eagle.
  • Content management pipelines — index layer names, entity counts, and drawing extents for a library of DXF assets without opening a CAD viewer.
03API WORKFLOW

Upload, poll, retrieve.

Authentication is an API key in the Authorization: Bearer header. The base URL is https://api.cadlens.co/v1.

Step 1 — Upload the DXF file:

POST /v1/parse
Content-Type: multipart/form-data
Authorization: Bearer <api_key>

file=<your-drawing.dxf>

// Response
{ "jobId": "job_02jk..." }

For files under roughly 2 MB, append ?wait=true to receive the complete result synchronously. For larger files the job is queued; add a webhook_url field to be notified on completion without polling.

Step 2 — Check status:

GET /v1/jobs/job_02jk...
Authorization: Bearer <api_key>

// Response
{
  "jobId": "job_02jk...",
  "status": "COMPLETED",   // PENDING | PROCESSING | COMPLETED | FAILED
  "fileName": "bracket.dxf",
  "fileSize": 48200,
  "createdAt": "2024-10-14T11:00:00Z",
  "completedAt": "2024-10-14T11:00:03Z"
}

Step 3 — Retrieve vector data and image:

GET /v1/jobs/job_02jk.../result   // vector JSON
GET /v1/jobs/job_02jk.../image    // signed PNG URL
04EXAMPLE OUTPUT

What a DXF parse returns.

The result schema is versioned at 2024-01. A typical DXF result for a mechanical part:

{
  "jobId": "job_02jk...",
  "status": "COMPLETED",
  "metadata": {
    "units": "mm",
    "boundingBox": { "width": 250, "height": 180 }
  },
  "layersJson": [
    { "name": "OUTLINE",  "colorHex": "#ffffff", "entityCount": 6  },
    { "name": "HOLES",    "colorHex": "#00bfff", "entityCount": 8  },
    { "name": "DIMS",     "colorHex": "#ffff00", "entityCount": 14 }
  ],
  "vectorJson": [
    {
      "type": "POLYLINE",
      "layer": "OUTLINE",
      "closed": true,
      "vertices": [
        { "x": 0,   "y": 0   },
        { "x": 250, "y": 0   },
        { "x": 250, "y": 180 },
        { "x": 0,   "y": 180 }
      ]
    },
    {
      "type": "CIRCLE",
      "layer": "HOLES",
      "center": { "x": 20, "y": 20 },
      "radius": 5
    }
  ],
  "imageUrl": "https://cdn.cadlens.co/results/job_02jk.../preview.png?..."
}
05LIMITATIONS

Fair-use and known constraints.

  • File size: approximately 10 MB per file on standard plans.
  • Entity count: up to approximately 50,000 entities per drawing.
  • Processing time: up to 30 seconds on standard plans; DXF files are typically the fastest to process.
  • Model space only: paper space (layout) entities are not currently extracted.
  • External references (Xrefs): referenced files are not resolved; only geometry in the submitted file is parsed.
  • Raster images embedded in DXF: the image entity location is returned but the raster data is not extracted.
06 — FAQ

Common questions.

CADLens supports DXF files from AutoCAD R12 through AutoCAD 2025. Both ASCII DXF and binary DXF are accepted.

DXF is an open, documented format, which means the parser can work directly from the specification rather than relying on reverse-engineering or a third-party SDK. For files where you have a choice of export format, DXF is the recommended input.

CADLens extracts polylines, lines, arcs, circles, splines, text, hatches, and block inserts. Each entity includes its layer name, coordinates, and optional color assignment.

Yes. The layersJson array in the result contains each layer name, its assigned color as a hex string, and the count of entities on that layer.

Model space entities are included by default. Paper space (layout) entities are not currently extracted. This covers the majority of DXF use cases where geometric data is in model space.

No. Only successful parses count toward your monthly quota. A job that ends in FAILED status is never billed.

JOIN THE BETA

Get an API key. Parse your first drawing today.

Free tier includes 50 parse requests per month. No credit card required.

Join the beta · Free 50/mo Read the docs
— RELATED

Keep reading.