form_create_primitive
Creates a T-spline primitive body and control mesh in Fusion's Form environment for box, plane, cylinder, sphere, torus, or quadball shapes with set sizes and face counts.
Instructions
Create a T-spline primitive body (Form environment) with its control mesh.
Sizes per shape (numbers in units):
box: x_size, y_size, z_size (x_faces, y_faces, z_faces);
plane: x_size, y_size (x_faces, y_faces);
cylinder: radius, height (radial_faces, length_faces);
sphere: radius (longitude_faces, latitude_faces);
torus: major_radius, minor_radius < major_radius (major_faces, minor_faces);
quadball: radius (faces).
Face counts default to Fusion's. A parameter of another shape -> INVALID_PARAMS.
T-spline primitives are NOT parametric: sizes are numbers, not expressions or user parameters (a string -> INVALID_PARAMS), and the body does not follow parameter changes. Shape it afterwards with form_move / form_crease / form_insert_edge, get a solid with form_convert_to_brep. Pull, Bridge, Fill Hole, Weld, Subdivide and the like have no Fusion API: read the TSM (form_get_tsm), edit it and create the body again (form_create_from_tsm).
Returns {"form": ref, "body": , "created_form": bool}; the body has a B-Rep ("brep_body") once Fusion regenerated it - a body without one fails (rolled back).
Example: form_create_primitive(shape="box", x_size=40, y_size=20, z_size=10, x_faces=4)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form | No | Existing form feature to add the body to (default: a new form feature) | |
| name | No | Name of the new body | |
| faces | No | ||
| shape | Yes | box, plane, cylinder, sphere, torus, quadball | |
| units | No | Unit of lengths and points (default mm) | mm |
| height | No | Number in `units`; expressions are not supported (not parametric) | |
| origin | No | Corner of box / plane, centre of the others (default 0,0,0) | |
| radius | No | Number in `units`; expressions are not supported (not parametric) | |
| x_size | No | Number in `units`; expressions are not supported (not parametric) | |
| y_size | No | Number in `units`; expressions are not supported (not parametric) | |
| z_size | No | Number in `units`; expressions are not supported (not parametric) | |
| x_faces | No | ||
| y_faces | No | ||
| z_faces | No | ||
| symmetry | No | {"x", "y", "z": bool} mirror symmetry, or "circular" (cylinder, sphere, torus) | |
| component | No | Component or occurrence for a new form feature (default: the root) | |
| major_faces | No | ||
| minor_faces | No | ||
| x_direction | No | Local X axis (default [1,0,0]) | |
| y_direction | No | Local Y axis, perpendicular to X (default [0,1,0]) | |
| length_faces | No | ||
| major_radius | No | Number in `units`; expressions are not supported (not parametric) | |
| minor_radius | No | Number in `units`; expressions are not supported (not parametric) | |
| radial_faces | No | ||
| latitude_faces | No | ||
| longitude_faces | No | ||
| symmetric_faces | No | Faces per symmetric segment (circular only) |