Drawing: Export DWG
drawing_export_dwgExport drawings to genuine DWG files in R2000–R2018 formats via AutoCAD SaveAs on a live seat, or headlessly through the ODA File Converter.
Instructions
Write a real DWG — not a DXF under a .dwg name.
On a live AutoCAD seat this is Document.SaveAs with the matching
AcSaveAsType, which (as AutoCAD's own SaveAs does) leaves the session bound
to the file it just wrote. Headlessly it needs the ODA File Converter; when
that is absent the call is refused with capability: "dwg_write" and the
refusal names the install route and drawing_export_dxf, which writes a
DXF AutoCAD opens unchanged. Check system_capabilities first: the ezdxf
flag is re-evaluated at call time, so installing the converter changes it
without a restart. An unknown version is refused by name with the six.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Full path of the .dwg to write. | |
| version | No | R2000 | R2004 | R2007 | R2010 | R2013 | R2018. | R2018 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||