LibreDWG File Parser
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
Related Skills
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
Publish HTML, static assets, or build output as a public link, with account management, update, deletion, and AI safety review.
A comprehensive browser automation guide covering navigation, interaction, multi-tab management, and data collection, tailored for domestic web ecosystems and tools like Playwright/Selenium.