cad
Perform CAD modeling operations on FreeCAD documents: create, edit, delete, or transform parts, with batch execution and session rollback.
Instructions
Perform a CAD modeling operation (unified mutation tool).
When a modeling session is active (session_start), successful operations
on the session's document are recorded as steps and can be rolled back
with session_rollback.
Feature ops take obj_name as the BASE object (for sketch/variables/
datum_plane/hull it names the NEW object) and params via obj_properties.
Every mutation runs in one FreeCAD transaction and is auto-audited for
connectivity. Call operation_help("<operation>") for the full parameter
reference of any operation — e.g. operation_help("sketch").
Args:
operation: The operation to perform.
doc_name: The document to operate on.
obj_type: Object type for create_object (e.g. "Part::Box").
obj_name: Base object name (new-object name for sketch/variables/
datum_plane/hull).
obj_properties: Properties/params for the operation.
ops: Operation dicts for batch.
stop_on_error: batch — stop at the first failed op.
description: Note recorded into the session step log.
with_screenshot: Attach a screenshot (default: none; use get_view).
Returns:
Result message (batch: JSON with per-op results), step number when a
session is active, and a screenshot only when requested.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | No | ||
| doc_name | Yes | ||
| obj_name | No | ||
| obj_type | No | ||
| operation | Yes | ||
| description | No | ||
| stop_on_error | No | ||
| obj_properties | No | ||
| with_screenshot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |