cad-bim-file-conversion

/home/avalon/.hermes/skills/productivity/cad-bim-file-conversion/SKILL.md · raw

CAD / BIM File Conversion

Use this when the user provides a real-estate/architectural download link or asks for files to be converted between CAD/BIM formats such as DXF, DWG, RVT, IFC, SKP, PDF floorplans, or SketchUp-compatible deliverables.

Workflow

  1. Download everything first. - Use the browser if the link is a download center with buttons/forms. - Also inspect visible direct links; providers sometimes expose CDN URLs. - Preserve originals in a task output directory.

  2. Do not trust displayed file extensions or CDN suffixes. - Real estate delivery platforms may show every file as .pdf even when the bytes are DXF, DWG, RVT, etc. - Always run file or equivalent magic-byte detection after download. - Rename/copy files to their real extensions before processing.

  3. Choose the conversion path by source format. - RVT → IFC / RVT → browser preview: Best done with Revit/Autodesk tooling. On Linux, treat clean RVT export or full RVT tessellation as unavailable unless a converter/service is installed. If the user compares against Autodesk Viewer and expects windows, doors, families, materials, category tree, and Autodesk-like navigation, do not substitute DXF/IFC fallback geometry and call it equivalent. Preserve/upload the RVT as source-of-truth and route the real fidelity path through Autodesk Platform Services (APS/Forge) model translation + Autodesk Viewer, or an actual Revit export pipeline. For app integration details, use references/aps-rvt-autodesk-viewer.md. - DWG → IFC: Requires DWG-capable tooling (ODA/AutoCAD/FreeCAD stack if available). Verify geometry after conversion. - DXF floorplan → IFC: Can produce a usable IFC from linework with ezdxf + ifcopenshell by creating IFC4 wall/proxy geometry from polylines/lines. - DXF/IFC linework → SketchUp import: If the user asks for .skp but no real SketchUp writer is available, generate a SketchUp-importable Collada .dae from centered/extruded linework and optionally package it as .kmz; see references/sketchup-importable-dae-kmz.md. - PDF floorplan → IFC: Use only as visual/reference input unless OCR/vector extraction is explicitly needed; prefer CAD sources when present.

  4. For a Linux DXF → IFC fallback: - Install/use Python packages ezdxf and ifcopenshell if available. - Read modelspace linework/polylines. - Detect units via $INSUNITS; common DXF unit code 4 is millimeters. - Center coordinates near origin to avoid huge-world-coordinate import issues. - Convert mm to m when creating IFC SI geometry. - Create an IFC4 project/site/building/storey hierarchy. - Extrude linework as thin wall geometry using ifcopenshell.api.geometry.create_2pt_wall or create proxy/mesh geometry when walls are inappropriate.

  5. Verify before sending. - Re-open the generated IFC with ifcopenshell.open. - Report schema and object counts. - Send the converted file directly, plus a concise caveat about fidelity if the source was only DXF linework.

  6. If the task expands into a browser BIM review app: - Use the pattern in references/browser-bim-review-studio.md. - Parse IFC metadata server-side and expose schema/entity counts in the project library. - Do not ship fake/count-driven 3D as if it were model geometry. If real geometry is not ready, show an honest placeholder plus source/download actions. - For a real browser preview, generate/load GLB: renderable IFC via ifcopenshell.geomtrimesh → GLB, or DXF linework via ezdxf extruded segments → trimesh → GLB. Verify the browser visibly loads real geometry before calling it done. - If the source is RVT and the user wants the Autodesk Viewer experience, the class of solution changes: implement APS/Autodesk Viewer (OAuth/token service, OSS upload, model derivative translation, URN loading) rather than improving a Three.js fallback. Three.js OrbitControls can improve navigation for GLB/DXF previews, but it does not recover missing Revit semantics.

User-facing handoff style

Keep the reply compact:

Pitfalls

References