Automation tools
Prism exposes 81 automation tools. Call them from Python with cad.call("name", **args), over HTTP with POST /call, or from an AI assistant through the MCP bridge (call_api). Sizes are millimetres with Z up. Face and edge indices are 1-based, like the labels in the app; Freeform cage indices are 0-based.
Inspect the document
get_state
Full snapshot: objects (with bounding boxes), selection, active command and its parameters/slots, sketch, camera, display flags, status line.
| Argument | Type | Description |
|---|---|---|
fields | array | Only these top-level keys, e.g. ["objects","selection","status"]. Default: all. |
objects | string | full (default) | names (one 'name [kind]' string per object, far smaller) | none. |
limit | integer | Most objects to list; objectsTotal gives the real count. |
object_info
Detailed information about one object: volume, area, size, center, validity, sketch plane.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
get_log
Recent status/error messages shown in the status bar (newest last).
| Argument | Type | Description |
|---|---|---|
count | integer | How many entries (default 30). |
screenshot
Capture the app window as a PNG. Whole window by default (ribbon, panels, viewport); viewport:true captures only the 3D view, which is what you usually want to judge a model and costs far fewer tokens. max_width shrinks the picture (e.g. 900). To judge a shape, pass views (front, back, left, right, top, bottom, iso; default front/right/top/iso): one labelled sheet of orthographic pictures at a common scale of just the objects named in object (a name or list; default every visible object), shaded without grid. The camera, display and visibility are restored afterwards. The reply gives each view's axes, pixelsPerMm and the bounds.
| Argument | Type | Description |
|---|---|---|
viewport | boolean | Only the 3D viewport. |
max_width | integer | Scale down to at most this many pixels wide. |
wait_ms | integer | Milliseconds to wait for a fresh frame before capturing (default 250). |
views | array | Standard views to combine into one labelled sheet: front, back, left, right, top, bottom, iso. An empty list means front, right, top, iso. |
object | any | With views: show only this object name (or a list of names). |
display | string | With views: shaded (default) | shaded_edges | wireframe. |
cell_width | integer | With views: width of each picture in pixels (default 480). |
columns | integer | With views: pictures per row (default 2). |
wait_idle
Wait until the view has stopped animating (after view, a tool that turns the camera, Tab in 3D sketch...) so the next pointer event or screenshot sees the final camera. Optional extra ms to wait afterwards.
| Argument | Type | Description |
|---|---|---|
timeout_ms | integer | Longest wait (default 3000). |
extra_ms | integer | Extra pause after it settles (default 100). |
solid_find
Find faces or edges of a solid/surface by geometry instead of by index. kind: faces (default) | edges. Filters (all optional, AND): type (Plane, Cylinder, Cone, Sphere, Torus, ... for faces; Line, Circle, ... for edges; prefix match), facing [dx,dy,dz] + angle (faces whose normal is within angle degrees, default 5), direction [dx,dy,dz] + angle (straight edges parallel to it, default 5), radius (+ radius_tol, default 0.001), box [[x0,y0,z0],[x1,y1,z1]] (centre inside), near [x,y,z] + distance (centre within distance), of_face N (edges bounding face N, 1-based), min_size / max_size (area for faces, length for edges). sort: size | -size | x | -x | y | -y | z | -z (centre coordinate), limit (default 40). select:true selects the hits (and they are listed 1-based, ready for run_command slots {object, face|edge}). summary:true returns only counts per type. Returns total, shown and the hits with type, centre, area/length, normal/direction, radius.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
kind | string | faces | edges. |
type | string | Surface/curve type. |
facing | array | Face normal direction. |
direction | array | Straight-edge direction. |
angle | number | Tolerance in degrees for facing/direction. |
radius | number | Radius of cylindrical/spherical faces or circular edges. |
radius_tol | number | Radius tolerance. |
box | array | Centre must lie inside this box. |
near | array | Point for distance filter. |
distance | number | Max centre distance from near. |
of_face | integer | Only edges of this face (1-based). |
min_size | number | Min area/length. |
max_size | number | Max area/length. |
sort | string | Sort order. |
limit | integer | Max hits listed (default 40). |
select | boolean | Select the hits. |
summary | boolean | Counts only. |
solid_check
Cheap verification of a body, or measurement between two things. With only 'object': validity, volume, area, bounding box, size, centre of mass, counts of faces/edges/shells/solids and open (free) edges. With 'a' and 'b' (each an object name or {object, face|edge}): the minimum distance between them and the two closest points; if they overlap, 'overlap' is true and the volume of the overlap is reported when both are solids.
| Argument | Type | Description |
|---|---|---|
object | string | Object to check (also used as 'a' when only 'b' is given). |
a | any | First item for a distance. |
b | any | Second item for a distance. |
Commands and the ribbon
list_commands
List the command names run_command accepts, optionally only those containing 'query' (case-insensitive). Without a query returns the count and the first 60.
| Argument | Type | Description |
|---|---|---|
query | string | Text the name contains, e.g. 'fillet' or 'cam'. |
limit | integer | Most names to return (default 60). |
describe_command
What a command needs before you run it: its selection slots (what each accepts, whether it is optional or takes several) and its parameters (type, default, unit, range, options). Nothing is started or changed. Then pass slots and params to run_command using these labels.
| Argument | Type | Description |
|---|---|---|
name required | string | Command name from list_commands. |
run_command
Run a modeling command end-to-end: start it, fill selection slots and parameters, then (by default) commit. Find names with list_commands(query). 'slots' maps a slot label to an object name, {object,face|edge} or an array of those; 'params' maps parameter labels to values. For curve_control/curve_through pass 'points' as [[x,y,z],...]. Use get_state afterwards, or call with commit=false to preview first.
| Argument | Type | Description |
|---|---|---|
name required | string | Command name. |
slots | object | Slot label -> selection. |
params | object | Parameter label -> value. |
points | array | Curve points for curve_control / curve_through. |
commit | boolean | Commit immediately (default true). |
command_set
Change parameters and/or selection slots of the command currently open in the panel (live preview updates).
| Argument | Type | Description |
|---|---|---|
params | object | Parameter label -> value. |
slots | object | Slot label -> selection. |
command_commit
Press OK on the active command.
No arguments.
command_cancel
Cancel the active command (or the sketch if one is open and no command is active).
No arguments.
list_ribbon
List every ribbon tab, group and button (label, enabled, checked). Use with ribbon_click.
No arguments.
ribbon_click
Click a ribbon button by its label (exactly what a user would click). Optionally pass 'tab' to disambiguate (e.g. 'Extrude' exists on Solid and Surface). Commands open their panel; use command_set / command_commit next.
| Argument | Type | Description |
|---|---|---|
label required | string | Button label, e.g. 'Box', 'Create Sketch', 'Finish Sketch'. |
tab | string | Tab name, e.g. 'Solid', 'Surface', 'Freeform'. |
marking_menu
The right-click marking menu. action: settings (open the Settings window) | menu (the 6 o'clock plain menu) | list (the eight entries for what is selected right now, clockwise from the top), open (show it at x,y in the viewport), run (index 0-7: do that entry).
| Argument | Type | Description |
|---|---|---|
action required | string | list | open | run |
index | integer | Entry 0-7 for run. |
x | number | Viewport x for open. |
y | number | Viewport y for open. |
edit_feature
Edit an earlier feature (the model rolls back to before it and its command reopens with the same picks and numbers; change values with command_set, then command_commit rebuilds the later steps). action: list (steps that can be edited) | open (step = history step id; omitted = the step that made the selected object).
| Argument | Type | Description |
|---|---|---|
action required | string | list | open |
step | integer | History step id from list or history_tree. |
Objects and selection
select
Set the document selection (outside of commands). Items are object names, or {object, face} / {object, edge} (1-based).
| Argument | Type | Description |
|---|---|---|
items required | array | Selection items. |
additive | boolean | Add to the existing selection. |
object_update
Rename, recolor or show/hide an object.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
name | string | New name. |
color | string | Hex colour like #E5484D. |
visible | boolean | Visibility. |
delete_objects
Delete objects by name.
| Argument | Type | Description |
|---|---|---|
objects required | array | Object names. |
origin
Show or hide the origin helpers (they also appear in the browser): planes, axes, origin point.
| Argument | Type | Description |
|---|---|---|
planes | boolean | XY/XZ/YZ planes. |
axes | boolean | X/Y/Z axes. |
point | boolean | Origin point. |
Sketching
sketch_begin
Start a sketch. plane: 'XY', 'XZ' or 'YZ' (optional offset along the normal), a planar face {object, face}, or an origin plane name. To edit an existing sketch pass edit:'Sketch 1' (its constraints and dimensions are preserved).
| Argument | Type | Description |
|---|---|---|
plane | any | 'XY' | 'XZ' | 'YZ' | the name of a construction plane | |
offset | number | Offset along the plane normal (mm). |
edit | string | Name of an existing sketch object to edit. |
look_normal | boolean | Align the camera when starting; false preserves the current 3D view. |
sketch_plane
Control the unified sketch work plane. Actions: select (1-based index), new, xy, xz, yz, origin ([x,y,z] mm), rotate ([x,y,z] world degrees), size (display multiplier), snapping (other_curves and project), normal, gizmo, edit. Existing curves retain their original drawing planes.
| Argument | Type | Description |
|---|---|---|
action required | string | Plane action. |
index | integer | 1-based plane index. |
value | any | [x,y,z] for origin/rotate; number for size. |
other_curves | boolean | Enable external curve snaps. |
project | boolean | Allow explicitly labeled off-plane projection. |
sketch_add
Add geometry to the open sketch using the same tools as the mouse (so auto-constraints apply: coincident joints, horizontal/vertical, tangents...). Coordinates are 2D [u,v] on the sketch plane. Entity types: line {points:[[u,v],[u,v]]}; polyline {points, closed?}; rect {corner1, corner2} | {center, corner} | {points:[p1,p2,p3]} (3-point); circle {center, radius} | {points:[p1,p2]} (2-point) | {points:[p1,p2,p3]} (3-point); arc {points:[start,mid,end]} | {center, start, end}; ellipse {center, major:[u,v] (end of one axis), minor (other radius)}; line also takes midpoint:true ([middle, end]); polygon {center, radius, sides, circumscribed?}; slot {center1, center2, width}; spline {points, closed?, control?}; point {at:[u,v]}; text {text, at:[u,v] (lower-left of the first line, default [0,0]), height? (mm, default 10), font? (an installed font, default Arial), bold?, spacing? (extra letter spacing, mm); line breaks start a new line}. Add "construction":true for reference geometry.
| Argument | Type | Description |
|---|---|---|
entities required | array | List of entity objects. |
sketch_state
The open sketch's model: points, entities (ids), constraints and dimensions, degrees of freedom and solver status. Refs use 'p<id>' for points and 'e<id>' for entities.
No arguments.
sketch_constrain
Add a geometric constraint. type: horizontal | vertical | coincident | parallel | perpendicular | tangent | equal | midpoint | concentric | collinear | symmetric | fix. refs: ids like 'e3' (entity) and 'p5' (point) - e.g. horizontal ['e3'] or ['p1','p2']; coincident ['p1','p2'] or ['p1','e4'] (point on curve); parallel ['e1','e2']; midpoint ['p3','e1']; symmetric ['p1','p2','e5']; fix ['p1'] or ['e2'].
| Argument | Type | Description |
|---|---|---|
type required | string | Constraint type. |
refs required | array | Point/entity ids, e.g. ["e1","p3"]. |
sketch_dimension
Add a driving dimension; the sketch is solved to match. type: length (line) | distance (two points) | hdistance | vdistance | radius | diameter | angle (two lines, degrees) | point_line. refs like constrain. value in mm (or degrees).
| Argument | Type | Description |
|---|---|---|
type required | string | Dimension type. |
refs required | array | Ids, e.g. ["e1"] or ["p1","p2"]. |
value required | number | Target value. |
sketch_set_dimension
Change the value of an existing dimension (by constraint id from sketch_state) - the sketch updates parametrically.
| Argument | Type | Description |
|---|---|---|
constraint required | integer | Constraint id. |
value required | number | New value. |
sketch_project
Bring geometry from outside into the open sketch (locked in place). mode edge: project one edge of an object (object name or id, edge index) | body: project all edges of an object | section: the curves where an object crosses the sketch plane. Good for lofts: copy or slice an existing body to get matching profiles.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name or id. |
mode required | string | edge | body | section |
edge | integer | Edge index (edge mode). |
sketch_mirror
Mirror sketch entities across a line entity. live=true keeps the copy tied to the original with symmetry constraints.
| Argument | Type | Description |
|---|---|---|
entities required | array | Entity ids like ['e3','e4']. |
axis required | string | Line entity id to mirror across, like 'e7'. |
live | boolean | Keep symmetric (default true). |
sketch_trim
Trim a line, arc or circle: removes the part of curve 'e3' nearest to the point at:[u,v], cutting back to the crossing curves on each side (a curve nothing crosses is deleted).
| Argument | Type | Description |
|---|---|---|
entity required | string | Entity id like 'e3'. |
at required | array | Point [u,v] on the part to remove. |
sketch_pattern
Repeat sketch entities. type linear: offset [du,dv] between copies. type circular: center [u,v] and optionally angle (degrees between copies; default = evenly around 360). count = total copies including the original.
| Argument | Type | Description |
|---|---|---|
entities required | array | Entity ids like ['e3','e4']. |
type required | string | linear | circular |
count required | integer | Total copies including the original. |
offset | array | Linear: [du,dv]. |
center | array | Circular: [u,v]. |
angle | number | Circular: degrees between copies. |
sketch_delete
Delete sketch entities ('e3') or constraints (by id).
| Argument | Type | Description |
|---|---|---|
entities | array | Entity ids, e.g. ["e3"]. |
constraints | array | Constraint ids (integers). |
sketch_input
Drive the open sketch like the mouse and keyboard. Optionally pick a tool (line, line_mid, rect, rect_center, rect_3pt, ellipse, circle, circle_2pt, circle_3pt, polygon, slot, spline, spline_control, edit_spline, select, fit_section_curve, constrain:<type>), then send events: {type:'move'|'down'|'up'|'click'|'dclick'|'key', u, v (sketch plane coords), shift, alt} or {type:'key', key:'Char:5'|'Tab'|'Enter'|'Escape'|'Back'|'Delete'|'RightClick'|'Char:L'|'Char:C'|'Char:X'}. Returns the on-screen read-out labels, the status line and the sketch state.
| Argument | Type | Description |
|---|---|---|
tool | string | Tool to activate first. |
events | array | List of event objects. |
type | string | Event types, see above. |
sketch_finish
Finish the open sketch (keep=true creates/updates the Sketch object, false discards it). Returns a short status; verbose:true returns the whole document state.
| Argument | Type | Description |
|---|---|---|
keep | boolean | Default true. |
verbose | boolean | Return the full state. |
Freeform and NURBS
form_info
Read a Form object (subdivision cage): vertices, faces (vertex index lists, 0-based, CCW from outside), creased edges, smoothing level. Indices here are 0-based and are what form_op expects.
| Argument | Type | Description |
|---|---|---|
object required | string | Form object name. |
summary | boolean | Counts and bounding box only (no vertex or face lists). |
only | array | Vertex indices: return only the positions of these vertices. |
form_find
Find cage components by geometry so you do not have to read the whole cage. kind: vertices | faces | edges (default faces). Filters (all optional, combined with AND): box [[x0,y0,z0],[x1,y1,z1]] (a vertex, or a face/edge centre, inside), near [x,y,z] + radius, facing [dx,dy,dz] + angle (faces whose normal is within angle degrees, default 30), open:true (edges used by one face only), all:true. Returns 0-based indices ready for form_op / form_select, with centres (and normals for faces).
| Argument | Type | Description |
|---|---|---|
object required | string | Form object name. |
kind | string | vertices | faces | edges. |
box | array | [[x0,y0,z0],[x1,y1,z1]] |
near | array | [x,y,z] |
radius | number | With near: distance (mm). |
facing | array | Faces whose outward normal points this way [dx,dy,dz]. |
angle | number | With facing: tolerance in degrees (default 30). |
open | boolean | Edges with one face only (boundary). |
all | boolean | Every component. |
limit | integer | Maximum results (default 200). |
form_analyze
Surface quality of a Form: cage statistics (quads, triangles, n-gons, poles with their positions, edge lengths, stretched quads), curvature of the smooth surface (mean, tightest radius and where), and optionally the deviation to a reference object (scan, body, form): within-tolerance percentage, RMS, bias, largest gaps. display:true also colors the form by that deviation in the viewport.
| Argument | Type | Description |
|---|---|---|
object required | string | Form object name. |
reference | string | Object to compare the smooth surface with. |
tolerance | number | Deviation tolerance in mm (default 0.2). |
range | number | Color range ± in mm (default 1). |
display | boolean | Color the form by deviation. |
poles | boolean | Include pole positions (default true). |
form_op
Edit a Form cage (undoable). op: chamfer (edges or faces, amount: replaces each inner edge with a strip of faces) | slide (edges, amount -1..1: slide an edge loop along its rails) | crease_vertices (vertices, value: sharp corner points) | set_symmetry (symmetry x|y|z|radial:N|off, enforce:true makes the cage exactly symmetric from the + side, keep_positive:false for the - side) | move | rotate | scale | bridge | fill_holes | merge_faces | merge_edges | unweld_edges | pull | collapse_edges | split_face | smooth | flatten | set_vertices | extrude_faces | extrude_edges | inset | bevel | insert_loop | subdivide | delete_faces | weld | flip | crease | mirror | add_face | thicken | level. A form with a persistent symmetry (set_symmetry) repeats extrude/inset/bevel/delete/crease/flatten/smooth/weld/collapse/unweld/pull/insert_loop/merge_faces on the mirror images of whatever you select; pass symmetry:off to bypass it for one call. pull: vertices (or all) move onto the smooth limit surface (strength 0..1). merge_edges: edges:[[a,b]..] removes inner edges, joining the faces either side. unweld_edges: edges (or faces) split the cage along them so each side gets its own points. bridge: faces:[a,b] removes two separate equal-corner cap faces and joins their loops (for integrated handles), or edges:[[a,b],...] selects two separate boundary chains. move/rotate/scale act on the vertices of whatever you select and accept soft_radius (+ falloff smooth|linear|sharp) and symmetry (x | y | z mirror, or radial:N around Z; mirrored points follow). rotate: axis X|Y|Z, angle (degrees), optional pivot [x,y,z] (default the selection centre). scale: factor, or scale [sx,sy,sz], optional pivot. inset: faces, amount, optional depth and individual:true. bevel: edges or faces, amount (support loops that tighten the edge). insert_loop: edge [a,b], optional count and position (0..1 from a). Components are 0-based indices from form_info: vertices:[i..], faces:[i..], edges:[[a,b]..]. move: delta [dx,dy,dz] applied to the vertices of whatever you select. set_vertices: positions {"3":[x,y,z]}. extrude_faces/edges: distance. insert_loop: edge [a,b]. crease: value (0 clears). mirror: plane XY|XZ|YZ (welds the seam). add_face: vertices [ids] and/or points [[x,y,z]] (new corners) - ids first. level: value 1-4.
| Argument | Type | Description |
|---|---|---|
object required | string | Form object name. |
op required | string | Operation. |
vertices | array | Vertex indices. |
faces | array | Face indices. |
edges | array | Edges as [a,b] pairs. |
edge | array | One edge [a,b]. |
delta | array | [dx,dy,dz]. |
distance | number | Extrude distance. |
value | number | Crease sharpness or smoothing level. |
plane | string | Mirror plane. |
positions | object | Vertex index -> [x,y,z]. |
points | array | New corner points. |
angle | number | rotate: degrees. |
axis | string | rotate: X | Y | Z. |
factor | number | scale: uniform factor. |
scale | array | scale: [sx,sy,sz]. |
pivot | array | rotate/scale pivot [x,y,z]. |
soft_radius | number | Soft selection radius (mm; 0 = off). |
falloff | string | smooth | linear | sharp. |
symmetry | string | x | y | z | radial:N | off. |
all | boolean | move/rotate/scale/smooth/flatten: act on every vertex when nothing is selected. |
amount | number | inset / bevel size (mm). |
depth | number | inset: push out (+) or in (-). |
individual | boolean | inset each face on its own. |
count | integer | insert_loop: number of loops. |
position | number | insert_loop: 0..1 from the first vertex of the edge. |
form_select
While Edit Freeform is open (run_command edit_form with commit=false), select cage components so the manipulator and highlights show. mode: vertices|edges|faces. Indices are 0-based as in form_info.
| Argument | Type | Description |
|---|---|---|
mode required | string | vertices | edges | faces |
all | boolean | Select every component of that kind. |
op | string | grow | shrink | invert | all | angle (flood faces from the selection) | boundary | creased: selection tools applied after any indices given. |
angle | number | With op angle: dihedral limit in degrees (default 30). |
vertices | array | Vertex indices. |
edges | array | [[a,b],..] |
faces | array | Face indices. |
form_to_nurbs
Convert a Form into exact NURBS geometry (a solid if the cage is closed, otherwise a surface). The result can be used with booleans, fillets, STEP export, etc.
| Argument | Type | Description |
|---|---|---|
object required | string | Form object name. |
detail | string | exact (default) | fewer: one fitted patch per irregular face instead of four, for lighter models. |
get_control_points
Read the NURBS control net of a curve or single-patch surface (rows x cols, row-major).
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
set_control_points
Replace the control points of a curve/surface (same count and order as get_control_points). Undoable.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
points required | array | [[x,y,z],...] - same length as get_control_points. |
Viewport and input
view
Control the camera and display. preset: front|back|left|right|top|bottom|iso. Or yaw/pitch in degrees. fit=true zooms to extents.
| Argument | Type | Description |
|---|---|---|
preset | string | Standard view. |
yaw | number | Yaw degrees. |
pitch | number | Pitch degrees. |
fit | boolean | Zoom to extents. |
orthographic | boolean | Projection. |
display | string | shaded | shaded_edges | wireframe |
xray | boolean | Enable or disable translucent X-ray, independently of display style. |
zebra | boolean | Zebra stripes. |
grid | boolean | Grid visibility. |
select_mode | string | object | face | edge |
distance | number | Camera distance. |
target | array | Camera target [x,y,z]. |
look_at | boolean | Look straight at the selected plane, face or sketch (or the open sketch). |
layout | string | single | dual (model + top) | quad (front, right, top + model) |
link | boolean | Link pan/zoom between the views of a multi-view layout. |
pointer
Send mouse events to the 3D viewport at world positions: events [{type:'move'|'down'|'up'|'click'|'dclick'|'drag', x,y,z, x2,y2,z2 (drag end)}]. A {type:'key', key:'Char:E'|'Tab'|'Enter'|...} event sends a viewport key. Returns the active command's first grab handle (origin, tip, value), every handle (label, origin, grip, value), the command gizmo (mode, center, arrow length, a grab point per axis, values) and the camera.
| Argument | Type | Description |
|---|---|---|
events required | array | Event objects. |
Documents, files and history
file
Document I/O. action: new | open | save | save_as | import_step | import_file (by extension: STEP, IGES, BREP, DXF, STL, OBJ, PLY, 3MF) | export_step | export_iges | export_brep | export_glb | export_dxf | export_stl (also .3mf/.obj/.ply by extension). 'path' required except for new/save.
| Argument | Type | Description |
|---|---|---|
action required | string | Action. |
path | string | File path. |
document_new
Open a new empty document in its own tab.
No arguments.
document_list
The open documents (tabs).
No arguments.
document_switch
Bring a document tab to the front by index (0-based) or title.
| Argument | Type | Description |
|---|---|---|
document required | string | Index or title. |
document_close
Close a document tab (discards unsaved changes).
| Argument | Type | Description |
|---|---|---|
document required | string | Index or title. |
history
Undo or redo.
| Argument | Type | Description |
|---|---|---|
action required | string | undo | redo |
count | integer | Repeat count (default 1). |
history_group
Fold a run of steps into ONE undo step. Call with action:begin, make changes, then action:end with a label. Groups nest.
| Argument | Type | Description |
|---|---|---|
action required | string | begin | end |
label | string | Name of the history step (end). |
history_view
Inspect or resize the design history panel. Collapsed mode shows a compact, interactive trail of the active branch.
| Argument | Type | Description |
|---|---|---|
expanded | boolean | Show the full branch graph, or the compact trail when false. |
height | number | Expanded graph height, clamped to 100–360. |
history_tree
The full history tree: every step with its parent, label, time, checkpoint name and which one is current. Branches exist when an edit was made after rolling back.
No arguments.
history_goto
Jump to a history step by id (see history_tree). Use this to switch between branches.
| Argument | Type | Description |
|---|---|---|
id required | integer | Node id. |
batch
Run several tool calls in order in one round trip. Stops at the first error. calls: [{tool, args}].
| Argument | Type | Description |
|---|---|---|
calls required | array | [{"tool": "...", "args": {...}}, ...] |
workspace
Switch workspace: design | drawing | scan | cae (or simulate) | assemble | render | ar | make | script | all. CAE includes Static, Thermal, Dynamics, Motion (kinematics and rigid-body motion of an assembly) and Fluids. make opens Manufacture/CAM.
| Argument | Type | Description |
|---|---|---|
id required | string | Workspace id; cae opens CAE, make opens CAM. |
Materials, rendering and drawings
material_list
List library materials with engineering data (density g/cm3, modulus GPa, yield/tensile MPa, conductivity, expansion, max temp, ratings). Short by default (id, name, category, density); pass brief:false for the full engineering data. Optional 'category' or 'search' filter.
| Argument | Type | Description |
|---|---|---|
category | string | e.g. Steel, Aluminum, Plastic. |
search | string | Text to match in name, family or uses. |
brief | boolean | Default true: id, name, category and density only. |
material_apply
Give an object a library material (color, finish and density come with it), or just set its finish/color. 'material' is an id or name from material_list; explicit visual overrides survive material assignment. Omit it to only edit appearance. Returns the object's mass when it is a solid.
| Argument | Type | Description |
|---|---|---|
object required | string | Object name. |
material | string | Material id or name. |
metal | number | 0..1 |
gloss | number | 0..1 |
color | string | Hex colour override like #C87941. |
clear | boolean | Remove the material. |
pattern | string | Automatic | Plain | Wood | Brushed | Cast | CarbonWeave. Appearance only. |
patternScale | number | Pattern size in mm, 0.1–10000. |
patternAngle | number | Pattern angle about world Z, degrees. |
roughness | number | 0 polished to 1 matte; exclusive with gloss. |
surface | object | Replace visual layers using SurfaceStyle JSON: Gradient 0..4, Axis 0..2, Color2/3/4 ARGB integers, GradientSize/Offset/Angle, Weathering 0..2, Coverage, PatchSize, WeatheringRoughness, BottomOnly, WeatherHeight, Seed, Bump, Coat, CoatRoughness, TextureSize/Angle and embedded ColorMap/RoughnessMap/BumpMap. |
resetAppearance | boolean | Restore assigned material/default appearance. |
materials_panel
Open (open=true) or close the Materials workspace tab. Optionally select a library material in it.
| Argument | Type | Description |
|---|---|---|
open | boolean | Default true. |
material | string | Material id to highlight in the list. |
render_control
Inspect or control the current document's render. action: status | stop | save | close. Start with run_command(name=render, commit=false), then command_set parameters including 'Start render'. Status reports sample progress, completion and errors; save writes completed samples to PNG.
| Argument | Type | Description |
|---|---|---|
action required | string | status | stop | save | close |
path | string | Optional full PNG path for save. |
drawing_export
Produce an engineering drawing of the model and save it as .svg, .pdf or .dxf (chosen by the extension). Hidden-line-removed orthographic views in third-angle layout (front, top, right, iso by default; first_angle:true to swap) at an automatic standard scale, with overall dimensions, hole callouts (Ø, count, THRU or depth), centerlines and locating dimensions, optional section and detail views, hand-placed annotations (dimension, diameter, radius, note, balloon, datum, gdt frames, surface finish), a bill of materials when several bodies are drawn, general tolerance and notes, and a title block. Drawn from the named objects, or every visible solid/surface/Freeform when none are named. View coordinates in sections/details/annotations are the view's drawing coordinates in mm: front x = model X, y = model Z; top x = X, y = Y; right x = Y, y = Z.
| Argument | Type | Description |
|---|---|---|
path required | string | Output file: .svg, .pdf or .dxf. |
objects | array | Object names to draw (default: all visible bodies). |
views | array | front | back | top | bottom | left | right | iso (default front, top, right, iso). |
sheet | string | A4 | A3 (default) | A2 | A1 | A0 | Letter | Tabloid | ANSI-C | ANSI-D. |
scale | number | Drawing scale, e.g. 0.5 for 1:2 (default: automatic). |
units | string | mm (default) or in: dimension text units. |
title | string | Title (default: the object name). |
part_number | string | Part number. |
material | string | Material note (default: the first object's material). |
drawn_by | string | Drawn by. |
company | string | Company name. |
revision | string | Revision letter (default A). |
notes | array | General note lines. |
tolerance | string | General tolerance text (default LINEAR ±0.1 ANGULAR ±0.5°). |
dimensions | boolean | Overall dimensions (default true). |
hole_callouts | boolean | Ø callouts for holes and bosses (default true). |
centerlines | boolean | Centerlines and center marks (default true). |
locating_dimensions | boolean | Hole position dimensions (default true). |
first_angle | boolean | First-angle projection. |
bom | boolean | Bill of materials table (default: when more than one part). |
sections | array | Section views: [{parent:'front', direction:'vertical'|'horizontal', offset: position in the parent view's mm coordinates (default the middle)}]. Lettered A-A, B-B, hatched, with the cutting line on the parent. |
details | array | Detail views: [{parent:'front', center:[x,y], radius, ratio (magnification relative to the sheet scale, default 3)}]. |
annotations | array | Hand-placed items: {type: dimension|diameter|radius|note|balloon|datum|gdt|finish, view, from:[x,y], to:[x,y], at:[x,y], center:[x,y], radius, angle, offset, orientation: horizontal|vertical|aligned, text, tolerance (e.g. '+0.1/-0.05'), number (balloon), symbol (gdt: flatness, straightness, circularity, cylindricity, perpendicularity, parallelism, angularity, position, concentricity, symmetry, runout, total_runout, profile_line, profile_surface), datums:'A|B'}. |
Meshes
mesh_import
Import a mesh file (STL, OBJ, PLY, 3MF) as one or more mesh objects. Without options it imports as-is (mm, Z-up, no repair). Colours and parts in the file are kept.
| Argument | Type | Description |
|---|---|---|
path required | string | Full path of the file. |
units | string | auto (default: the 3MF's own unit, else mm) | mm | cm | m | inch. |
up_axis | string | z (default, keep) | y (rotate Y-up to Z-up) | x (rotate X-up to Z-up). |
weld_tolerance | number | Merge vertices closer than this many mm (default 0: identical corners only). |
auto_repair | boolean | Merge, clean, fix normals and fill small holes (default false). |
split | string | auto (default: 3MF objects become separate bodies) | none | groups (file parts: 3MF object, OBJ object/group, STL solid) | components (connected pieces). |
reduce_percent | number | Reduce faces on import: keep this percentage of the triangles (default: no reduction). |
reduce_to | integer | Reduce faces on import to about this many triangles for the whole file (default: no reduction). |
mesh_export
Export meshes/bodies to STL, 3MF, OBJ or PLY (chosen by the extension). Exports the selection, or everything when nothing is selected.
| Argument | Type | Description |
|---|---|---|
path required | string | Output path. |
mesh_region
Select triangles on a mesh (the region later used by mesh_fit_surface, extract and delete). action: smart (flood a smooth patch from the triangle nearest 'at', with 'angle'), brush (triangles within 'radius' of 'at'), box (triangles whose centroid is inside 'min'/'max'), grow, shrink, invert, all, clear, extract (new mesh), delete. mode: replace (default) | add | subtract.
| Argument | Type | Description |
|---|---|---|
object required | string | Mesh object name. |
action required | string | smart | brush | box | grow | shrink | invert | all | clear | extract | delete |
at | array | [x,y,z] point on or near the surface. |
angle | number | Edge angle in degrees for organic surfaces (default 20). |
tolerance | number | Surface tolerance in mm for the shape fit (default 0.3% of the mesh size). |
radius | number | Brush radius in mm. |
min | array | [x,y,z] box corner. |
max | array | [x,y,z] box corner. |
mode | string | replace | add | subtract |
Simulation and workflows
study_new
Start a static study on a solid body (the selected one, or the named one). Then add fixtures and loads with run_command sim_fixed / sim_roller / sim_force / sim_pressure / sim_torque / sim_gravity and call study_run.
| Argument | Type | Description |
|---|---|---|
object | string | Body name (default: the selection). |
element_size | number | Target element size in mm (0 = automatic). |
study_run
Mesh and solve the active study (blocks until done) and return the key results. Optionally switch the displayed result: von Mises, displacement, safety.
| Argument | Type | Description |
|---|---|---|
show | string | von Mises | displacement | safety |
study_state
The active static study: fixtures, loads, mesh size and (if solved) the key results and notes.
No arguments.
cae_state
CAE solver status and results. Start cae_thermal or cae_modal with run_command(commit=false), configure body/faces/material and parameters, then command_set with 'Run analysis':true. action: status | stop. Case files remain in resultFolder. Fluids currently use the separate cae_pipe_flow reduced-order command.
| Argument | Type | Description |
|---|---|---|
action | string | status (default) | stop |
workflow_state
Saved CAE setups, named selections, CAM setup and live path playback. Optional staticStudy selects a static study by name.
| Argument | Type | Description |
|---|---|---|
staticStudy | string | Optional saved static study name. |
Scripts and the assistant
script_dialog
Show a dialog and wait for the user: fields [{key, label, type: number|text|check|choice, value, min, max, step, options, unit}]. Returns {ok:true, values:{key: value}} or {ok:false} when cancelled. Meant for scripts that need input.
| Argument | Type | Description |
|---|---|---|
title | string | Dialog title. |
fields required | array | Field definitions. |
assistant
Drive the in-app AI assistant panel (for testing the assistant itself). action: open | close | send (text) | transcript | new | provider (index 0 Codex login, 1 Claude API key, 2 OpenAI/Codex API key).
| Argument | Type | Description |
|---|---|---|
action required | string | open | close | send | transcript | new | provider |
text | string | Message for send. |
index | integer | Provider index. |
Other
datum
Model datums and the move gizmo. action: arm (kind: point|axis|plane — the persistent click-to-place tool; click with the pointer tool), finish (stop placing), gizmo (show the free gizmo; move:true = the Move tool's grab mode), bind (bind the current selection to the gizmo), list (placed datums).
| Argument | Type | Description |
|---|---|---|
action | string | arm | finish | gizmo | bind | list. |
kind | string | point | axis | plane. |
move | boolean | Arm Move mode on the gizmo. |
drawing_document
Edit the Drawing workspace document using the same model and history as the desktop editor. Actions: state, new_sheet, sheet_settings, add_view, suggest, accept, move, update, parts, delete_annotation, export. New views have no automatic annotations. View kinds: base, section, detail; projected orientations: projected:above/below/left/right with parent_id. Suggestions are previewed until accepted. PDF can include all sheets.
| Argument | Type | Description |
|---|---|---|
action required | string | Operation |
sheet_id | string | Sheet identity; defaults to first sheet |
view_id | string | View identity |
parent_id | string | Parent view identity |
orientation | string | front/top/right/back/left/bottom/iso or projected:above/below/left/right |
kind | string | base/section/detail |
sources | array | Source body names or IDs; required for a base view |
x | number | Paper X or move delta in mm |
y | number | Paper Y or move delta in mm |
scale | number | Positive view scale |
vertical | boolean | Vertical section cutting line |
cut | number | Section coordinate in model mm |
radius | number | Detail radius in model mm |
ratio | number | Detail magnification |
category | string | Overall size / Diameters / Center marks / Hole positions |
suggestions | array | Suggestion IDs from the most recent preview |
annotation_id | string | Annotation identity |
settings | object | Sheet settings: name/title/number/material/notes/units/format/scale/generalTolerance |
path | string | Export file path .pdf/.svg/.dxf |
all | boolean | Export all sheets to PDF |
guide
Read a built-in how-to for doing a kind of work well. With no topic it lists them. Read 'freeform' before building any curved or organic shape: it covers describing a shape by stations and silhouettes, measuring it with solid_profile and screenshot views, and the usual failure modes.
| Argument | Type | Description |
|---|---|---|
topic | string | Guide name, for example freeform. Omit to list the guides. |
pick_at
What a viewport click at this world point would pick through the given filter (or the active slot's filter): item, kind, index and a readable name. Diagnostic for pick wiring.
| Argument | Type | Description |
|---|---|---|
at required | array | World point [x,y,z] to project and pick. |
filter | string | Optional filter like 'Edge' or 'SketchObj|CurveObj|Face|Edge' (default: the active filter). |
render_setup
The picture-wide render choices stored on the document. action: state (current setup) | set (env, background, exposure, fit, offsets) | set_background (import a PNG/JPEG file as the backdrop image; produces it first with run_script if asked to generate one).
| Argument | Type | Description |
|---|---|---|
action required | string | state | set | set_background |
env | string | studio | sky | dark_studio | lights_only | hdr |
background | string | environment | white | transparent | green | black | gradient | image |
exposure | number | 0.1-10. |
fit | string | fill | fit | stretch (background image only). |
offset_x | number | -1..1 |
offset_y | number | -1..1 |
path | string | Full path of the image file for set_background (≤16 MB; the generated folder Prism/generated is the right place for AI-made backdrops). |
script_editor
The built-in script editor (one Python file). action: open | state | get | set (replace ALL of the script; keeps a rollback point) | insert (text before 'line', default: at the end) | rollback (restore the previous version; repeat to step back) | run | save.
| Argument | Type | Description |
|---|---|---|
action required | string | open | state | get | set | insert | rollback | run | save |
text | string | Source code for set/insert. |
line | integer | Insert before this 1-based line; default appends. |
path | string | Save path for save. |
select_tab
Switch the ribbon to a workspace tab by its title (for example Static, CAM, Solid). The document remembers it and reopens on that tab.
| Argument | Type | Description |
|---|---|---|
title required | string | Tab title, matched case-insensitively. |
command | string | Optional command name (for example cam_playback or drive_joints) to leave open when the file is opened, so the user only presses its Play or Run button. Omit to clear. |
settings
Application and assistant settings. action: list | get | set | reset | open (open the Settings window at 'page'). 'key' comes from list, 'value' for set. API keys and the automation token are never exposed.
| Argument | Type | Description |
|---|---|---|
action required | string | list | get | set | reset | open |
key | string | Setting key from list. |
value | any | New value. |
page | string | Settings page for open: appearance | interaction | workspace | toolbars | ribbon | assistant | keyboard |
solid_profile
Look at a shape in numbers and text, for judging proportions without a picture. Works on a Freeform, solid, surface or mesh (or a list of them, measured together). sections: cross-sections perpendicular to axis (x|y|z, default z) at count evenly spaced offsets (default 10) or at the offsets in at: for each cut the two extents (min/max), the section area, the centroid and how many separate outlines it has; an empty cut means the shape does not reach that offset. silhouettes: ASCII pictures (front: x right z up; right: y right z up; top: x right y up) at the stated mm per column; shade:true adds a depth ramp (@ nearest to . farthest). Use it to check that a neck is narrower than a shoulder, a handle really is a loop, or a part is lopsided.
| Argument | Type | Description |
|---|---|---|
object required | any | Object name, or a list of names. |
axis | string | Section axis: x | y | z (default z). |
count | integer | Evenly spaced sections (default 10; 0 = none). |
at | array | Section offsets along the axis in mm (instead of count). |
views | array | Silhouettes to draw: front, right, top (default all three; [] = none). |
width | integer | Silhouette width in characters (default 48). |
rows | integer | Most rows a silhouette may use (default 26); a tall shape gets a coarser grid instead. |
shade | boolean | Silhouette uses a depth ramp instead of #. |