sketch_constrain
Apply ordered geometric constraints—such as coincident, parallel, tangent, and fix—to Fusion 360 sketch entities to control relationships and reject invalid or over-constrained input atomically.
Instructions
Add geometric constraints in order, all or nothing.
Entities are refs from earlier results (sketch_draw refs, sketch_get) or origin.
Types: coincident (point, entity) | horizontal / vertical (line, or points: [p1, p2])
| parallel / perpendicular / collinear (line1, line2) | tangent / equal / concentric
(curve1, curve2) | midpoint (point, curve) | symmetry (entity1, entity2, line) |
smooth (spline, curve) | fix (entity, fixed=true — sets isFixed, no constraint ref).
Wrong entity types fail with INVALID_PARAMS (details.expected); an over-constrained
sketch fails with FUSION_API_ERROR and details.index; nothing is kept on failure.
Returns {"constraints": [{ref, type}], "status", "profiles"}.
Example: sketch_constrain(sketch=, constraints=[{"type": "horizontal", "points": [, ]}, {"type": "equal", "curve1": , "curve2": }]).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sketch | Yes | Sketch ref (from sketch_create) | |
| constraints | Yes | ||
| return_profiles | No | Add the current profiles to the result (false = faster) |