Evaluate CAD Script
evaluate_scriptUse this when you need to run a script and check it compiles. Run a kernelCAD .kcad.ts script and report pass/fail + feature count + diagnostics. When the scene is assembly-built (assembly().part(...) → .model()/.solvedModel()), also returns a parts summary { count, names }. Pass either { file: "" } or { code: "" }. Set { dryRun: true } for fast validation while iterating: transpile + capture + capture-light checks WITHOUT OCCT lowering, DFM gates, or meshing — milliseconds instead of seconds (100x+ on boolean/fillet-heavy scripts). A dry run catches script throws, capture-time API misuse, and assembly validity-gate failures, but NOT lowering failures or dfmSpec diagnostics; it leaves the active session untouched, so finish with a full (non-dry) evaluate_script before using session-dependent tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. | |
| dryRun | No | Fast validation only: skip OCCT lowering, DFM gates, and meshing. Does not set or clear the active session. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the script compiled and lowered cleanly. | |
| parts | No | Assembly parts summary { count, names } when the scene is assembly-built. | |
| dryRun | No | True when the result came from a fast dry run. | |
| diagnostics | Yes | ||
| featureCount | Yes | Number of features captured by the script. |