AI Agent Hub
Back to skills
LibreDWG File Parser icon

LibreDWG File Parser

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_463e8e26/libredwg according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem It Solves

DWG files often appear in architecture, mechanical design, and CAD handoffs, but general-purpose pipelines may not parse their objects, layers, text, or vector output directly. This skill targets scripted inspection and conversion, making DWG data available to JSON, DXF, GeoJSON, SVG, PostScript, and other downstream workflows.

How It Works

It wraps the LibreDWG command-line tools. Core capabilities include:
- dwgread: read DWG and export formats such as .json, .dxf, .dxfb, and .geojson
- dwg2dxf / dxf2dwg: convert between DWG and DXF
- dwglayers: list layers for filtering or audit
- dwggrep: search text inside DWG for keyword checks
- dwg2SVG: export 2D content as vector graphics
- dwgfilter: filter objects with jq-style expressions

A common workflow is to inspect the file or export JSON, filter by object type, layer, or text, then convert to the target format.

Boundaries and Cautions

Writer support depends strongly on version and DWG era: older releases are more stable for r2000 and earlier, newer releases improve r2004, while r2010 through r2018 may be unstable. dxf2dwg is usually limited to older output formats; dwg2SVG mainly handles 2D content and some entities may be missing; dwg2ps may require optional dependencies. Command casing, path escaping, and Chinese path encoding can vary by platform, so check output formats and optional dependencies when debugging.

Use Cases

  • Export DWG layers and text to JSON for review scripts in architectural deliveries
  • Convert legacy DWG files to DXF and filter LINE objects for downstream analysis
  • Render 2D DWG content as SVG for embedding in a web drawing viewer
  • Search specific text identifiers in DWG files with dwggrep during drawing acceptance

Best For

  • Backend engineers maintaining CAD data who need DWG objects in structured JSON
  • Drawing-review tool builders who need to list layers and search key fields
  • Web preview engineers who need to export 2D DWG content to SVG
  • Automation script authors who need batch DWG conversion and object filtering