cad_file
Perform file-level operations on CAD documents: create, open, save, close, delete, list, import, and export interop files like STEP, DXF, STL, DWG, or JSON.
Instructions
Create, open, save, close, delete, list, import or export files.
聚合文件操作。按 ``action`` 派发:create / open / save / close / delete /
list / import / export。
- ``create`` / ``open`` / ``save`` / ``close`` / ``delete`` / ``list``:
manage in-memory documents. ``open`` and ``save`` read/write the JSON
scene format; ``create`` starts a new document (optional ``template`` /
``unit``).
- ``export``: write the current document to an interop format — step
(recommended), dxf, stl, dwg or json — at ``path``.
- ``import``: load an interop file (.json / .dxf / .step / .dwg) as a new
document.
When not to use: ``cad_file`` handles whole files/documents. For
per-object geometry edits use ``cad_object``; to import/export raw JSON
scene data (not files) use ``cad_json`` (import_scene/export_scene).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File action to perform, discriminated by `action`: create, open, save, close, delete, list, import or export. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Saved / exported path | |
| files | No | Open files | |
| action | Yes | File action executed | |
| status | Yes | Operation status | |
| file_id | No | File unique identifier | |
| message | No | Status description | |
| filename | No | File name | |
| object_count | No | Number of imported objects |