SolidWorks-MCP
This MCP server lets an AI agent drive a running SolidWorks instance through typed tools to create, edit, verify, and export parametric parts and assemblies.
Build parts from primitives and profiles: boxes, cylinders, cones, discs, extrusions, revolves, sweeps, lofts, splines, ribs, slots, and sketches with lines/arcs/splines.
Add and cut real CAD features: holes, counterbores, Hole Wizard holes, ISO metric threads, bosses, text engraving/embossing, pockets, slots, shells, fillets, chamfers, full rounds, patterns, and mirrors.
Work on existing geometry: reference planes, faces, edges, bodies, combine/split bodies, imported STEP/IGES/Parasolid parts, read/extrude/cut existing sketches.
Edit parametrically: set named dimensions, add/delete equations, suppress/delete/reorder features, assign materials and appearances.
Inspect and verify: mass properties, bounding boxes, faces/edges, dimensions, feature history, sketch definitions, rebuilt features, and printability checks.
Assemble components: insert parts/subassemblies, position/rotate them, add mates, delete/suppress mates/components, check motion, interference, distances, and swept regions.
Output and manage files: export STEP/STL/IGES/Parasolid/3MF, screenshots, drawings, save/open parts and assemblies, list/activate documents, close documents.
Use mesh tools: slice STL/3MF cross-sections into profiles and compare the current part against a reference mesh.
Designed for agent self-correction: tools return measured geometry, fail loudly with readable errors, and expose a fixed typed tool surface with no arbitrary code execution.
SolidWorks MCP
Let an AI agent (Claude, or any other MCP client) model real parametric parts and assemblies in your own SolidWorks — and check its own work. Every modelling call returns the measured volume, mass and bounding box, so the agent can compare the result with the spec and correct itself instead of guessing that it "looks about right".
Why this server
It verifies, not just generates. Features report measured geometry; dimensions and mates are measured back after the rebuild.
Fully defined sketches. Every sketch is constrained the way a designer would: dimensions from the origin, relations only where the geometry is exactly horizontal, vertical or on the origin. Tools return their dimensions by role (
width@Sketch1), so the part stays editable, in SolidWorks or through the agent.Real CAD, not just primitives. Extrude, revolve, sweep, loft and splines; holes, counterbores, slots and pockets on any face; rounded polygon corners; ISO holes from the Hole Wizard; real ISO metric threads; fillets, chamfers, shells, patterns, mirrors, ribs, equations and materials. Assemblies with mates and interference checks. STEP/STL/3MF export and screenshots. Engraved and embossed text. Work on existing parts: list, delete, suppress and reorder features; read, extrude and cut a person's sketches; import STEP. Colours per part or component. Joints with concentric and angle mates, checked over their range. Printability checks and dimensioned drawings. Planes at any offset or angle. Several bodies per part, combined and split. Variable fillets and full rounds. Free sketches with tangent arcs and splines. 88 tools in total.
It fails loud. A call that cannot do what was asked returns
{ok: false, error}with the cause, never silently wrong geometry.A fixed, typed tool surface. There is no "run arbitrary code" tool; the agent can only do what the tools allow.
Tested against real SolidWorks. 764 tests; each feature's integration test compares the result with a hand calculation.
Local. It talks to your running SolidWorks over COM; the server itself makes no network calls.
Related MCP server: solidworks-mcp
Quickstart
Install uv.
Start SolidWorks and leave it open (the server attaches to the running instance — it does not launch one).
Register the server with your MCP client.
Claude Code:
claude mcp add solidworks -- uvx solidworks-mcpClaude Desktop (
claude_desktop_config.json) or any other client:{ "mcpServers": { "solidworks": { "command": "uvx", "args": ["solidworks-mcp"] } } }It is also listed in the official MCP Registry as
io.github.hjbaard/solidworks-mcp.Ask for a part, for example:
Design a 100 × 80 × 8 mm mounting plate with a Ø16 mm centre bore, four counterbored M5 holes 12 mm from the corners and R5 corners. Check the volume against your own calculation, then export a fine STL.
Guidelines for agents
The server hands every MCP client short modelling guidelines when it connects
(conventions, verify each step, known pitfalls). The full guide is the resource
solidworks://guide: recipes for holes, ribs, threads and assemblies, 3D-print
advice, and how to reverse-engineer a part from a mesh (STL/3MF). The same text
is in src/solidworks_mcp/guide.md.
Requirements and compatibility
Windows, with SolidWorks installed, licensed and running.
Python 3.11+ (uv fetches one if needed).
A Y-up part template, SolidWorks' standard. Since SOLIDWORKS 2025 new parts can also be Z-up; the tools build in the Y-up frame and refuse a Z-up part with a message that says so. Choosing Y-up in the New Document dialog is not used for parts made through the API: make a Y-up part, save it as a
.prtdot, and set that file as the part template under Tools > Options > System Options > Default Templates.Tested on SOLIDWORKS 2026 (3DEXPERIENCE R2026x). The API calls it uses exist since SOLIDWORKS 2020 SP2, so 2020–2025 should work, but that is untested. To check your installation, run this with SolidWorks open:
uvx solidworks-mcp --selftestIt builds a few small parts, compares each with a hand calculation and closes them unsaved. Please paste its output in a compatibility report, whether it worked or not.
Status: early (0.x). It works end-to-end, but tool names and conventions may still change. See CHANGELOG.md.
Troubleshooting
Start with the selftest:
uvx solidworks-mcp --selftestshows your SolidWorks release, language and templates, and which tool areas work. Add its output to a bug report.Drawings get slower and come out without dimensions, or SolidWorks freezes, after many tool calls — switch off Enhanced graphics performance (Tools > Options > System Options > Performance) and restart SolidWorks. With it on,
make_drawingslowed from 8 to 16 s over a series of calls and then placed 0 dimensions; with it off it stayed at 7 s."No running SolidWorks found" / connection fails — SolidWorks must be running before you start the server or run a script; it attaches to the active instance via
GetActiveObjectand does not launch one.First call is slow or
EnsureModuleerrors — the first COM call generates the makepy typelib wrappers under your tempgen_pyfolder. Let it finish; if it gets into a bad state, delete thegen_pycache and retry. Early binding is mandatory on this build (see Architecture).A feature returns
{ok: false, error: ...}— that is by design: every tool fails loud with a readable message rather than silently producing wrong geometry. Read the message; it names the likely cause.Only tested against SOLIDWORKS 2026 (3DEXPERIENCE R2026x). On other builds the verified enum values or method signatures may differ — re-run
scripts/introspect_api.pyto inspect your installed typelib.
Development
Clone the repository, then install it editable into a venv:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .[dev]To run the MCP server from this checkout instead of via uvx, point your client at the venv's Python:
{
"mcpServers": {
"solidworks": {
"command": "C:\\path\\to\\SolidWorks-MCP\\.venv\\Scripts\\python.exe",
"args": ["-m", "solidworks_mcp.server"]
}
}
}Run the verification scripts
With SolidWorks open:
.\.venv\Scripts\python.exe scripts\probe_connection.py # M0
.\.venv\Scripts\python.exe scripts\m1_block.py # M1
.\.venv\Scripts\python.exe scripts\m2_parametric.py # M2
.\.venv\Scripts\python.exe scripts\test_mcp_server.py # M3 (full MCP loop over stdio)
.\.venv\Scripts\python.exe scripts\m5_demo_bracket.py # M5 (3D-print bracket, every step verified)scripts/introspect_api.py regenerates/inspects the installed typelib and prints
verified enum values — run it if SolidWorks is upgraded and signatures change.
Tests
.\.venv\Scripts\python.exe -m pytest # all tests
.\.venv\Scripts\python.exe -m pytest -m "not solidworks" # fast unit layer, no SolidWorksTwo layers: pure unit tests (units, selector/direction parsing, polygon
cleaning, the component-placement maths, and that every MCP tool forwards its
arguments to the right session method) run anywhere; integration tests
(solidworks marker) drive a running SolidWorks and verify each feature's
volume — or each component's placement — against a hand calc. They auto-skip if
SolidWorks isn't reachable.
Tools
The server speaks MCP over stdio.
Part tools
Tool | Purpose |
| Is SolidWorks reachable? revision, server version, active/current part |
| Create a new empty part (becomes current) |
| Sketch rectangle + extrude; returns mass properties |
| Cylinder by revolving a profile 360° about an axis (Y axis) |
| Disc/puck/flange: circle extruded along +Z, centred at (x, y) (holes/patterns compose) |
| Cone/frustum by revolve (top Ø = 0 → full cone) |
| Revolve any closed |
| Sweep a round profile along a 2D path with rounded bends (pipes, tubes, rods), or along a spline through the points with |
| Sweep any closed cross-section along a 2D path (rails, gaskets, trim, channels); |
| Loft/blend 2+ polygon or round profiles on stacked parallel planes (transitions, adapters, a leg thick at the knee) |
| Loft through 2+ closed sketches on any planes, in order, so a loft runs in any direction |
| Straight rib / gusset in a plane parallel to Front at |
| Extrude any closed polygon |
| A reference plane offset from a plane, or turned about a model axis; its offset or angle a dimension; gives its origin and axes |
| Extrude a polygon drawn on any plane (3D points on it), merged with the part |
| The part's solid bodies: name, volume, bounding box |
| Add, subtract or intersect bodies of the part ( |
| Split the part into two bodies along a plane |
| Extrude a smooth closed spline through points (free-form/organic outlines) |
| Cut a circular through-hole at (x, y) through the depth axis |
| Counterbored screw hole (flush cap-head / heat-set insert) on +Z |
| Real, printable ISO metric thread (e.g. |
| Round hole on ANY planar face at a 3D point, through or blind (side holes, heat-set insert holes); the face through the point is used |
| ISO hole from SolidWorks' Hole Wizard tables: clearance (ISO 273 fits), counterbore, countersink or tapped; |
| Round boss (standoff, peg) grown out of ANY planar face |
| Polygon pad/ledge grown out of ANY planar face (3D points on the face) |
| Engrave text into ANY planar face, or emboss it: labels, version numbers; the position is two dimensions |
| Cut a polygon pocket/slot from the +Z face (blind or through), optionally turned about a pivot |
| Cut a polygon pocket on ANY face (3D points on the face) |
| Cut a polygon drawn on the Front/Top/Right plane or a plane by name, through all both ways or |
| Pocket a face leaving a rim along its outline (I-beam web, tray, frame); rim and depth are dimensions |
| Cut a straight slotted hole (obround) on the +Z face at any angle |
| Extrude a stadium (rounded tab, lug, link) between two points, the round ends centred on them |
| Round edges ( |
| Round a rib's top off completely between its two closest opposite sides |
| Chamfer edges at 45° ( |
| Hollow to a wall thickness; open a face ( |
| Repeat a feature N times along |
| Repeat a feature N times around an axis (bolt circle) |
| Mirror features (copies follow their seeds) or the whole body about the Front/Top/Right plane, or a plane by name, moved |
| Change a named driving dim (e.g. |
| Add a global equation or variable linking dims (e.g. |
| Add or replace a list of equations with one rebuild |
| List the equations (value, global, broken) / delete one by name or index |
| Cross-sections of an STL/3MF mesh as polygon loops, ready to use as profiles; needs no SolidWorks |
| Compare the part's cross-sections with a reference mesh (area and extent differences) |
| A sketch read back in model coordinates: lines, arcs, circles, splines, its dimensions, fully defined or not |
| Sketch an outline of lines, arcs and splines on any plane, fully defined: tangent where it flows, dimensioned from the origin |
| Build on an existing sketch by name (one a person drew): extrude it blind or up to the next face, or cut it blind or through all |
| Every dimension in the part, or those whose name or feature holds |
| The part's history in tree order (name, type, suppressed); flags features that fail to rebuild and sketches that are not fully defined |
| Undo a step: delete a feature with its sketch; refuses (and names them) while other features depend on it, unless |
| Take a feature out but keep it and its dimensions (try a variant); |
| Assign a material (e.g. |
| Force rebuild, report errors |
| Volume, mass, density, surface area, centre of mass, bounding box |
| Tight part bounding box (min/max/size, mm) |
| Inspect faces (normal/area/centre; a cylinder's axis, radius and centre, also of a component in an assembly) and edges (type/length/ends/axis) by index, narrowed to a face, a feature, a box or a length |
| For a print direction: overhanging faces (area, worst lean, centre), islands and edge stretches that start in the air, bed contact, height; with |
| STEP/STL/IGES/Parasolid/3MF (silent; verifies file). STL/3MF tessellation: |
| PNG/JPG/TIF from a standard view ( |
| 2D drawing as PDF or editable |
| Save to / open a native |
| Close the current part or assembly; without one, SolidWorks' active document if it is saved |
| The open documents (path, type, unsaved changes) / make one current again, also one never saved |
Assembly tools
Tool | Purpose |
| Create a new empty assembly (becomes the current document) |
| Open / save a native |
| Insert a part, or a |
| Name, path, fixed, position, rotation and bounding box of every component (its own extent, also when turned), and the mates with their dimensions and errors |
| Remove a component from the assembly, with its mates |
| Put another file in a component's place, keeping its position and, where they find their faces, its mates |
| Move/rotate a component; the transform is read back and verified |
| Mate two faces (by direction, or |
| Step a joint through its range: overlapping pairs and chosen distances per step, the smallest distance and where it occurs, the components that moved |
| What a component covers in a plane over a joint's range: its outline, with a margin, in the coordinates of the part to cut from |
| Delete a mate, or suppress it (and bring it back) |
| Component pairs whose solids overlap, with the volume in mm³ (touching faces don't count) |
| Smallest distance between two components, to a point (with the nearest point, and whether the point is in the material), or to an axis |
| Tight bounding box of the whole assembly (min/max/size, mm) |
export and screenshot work on assemblies too.
Faces are selected by direction in the component's own frame (+x, -z, …),
so a selector keeps meaning the same face however the component is turned. Add
:inner (e.g. +y:inner) for the cavity side of a hollow part — the inside of a
room wall instead of its outer skin.
All linear dimensions are millimetres; the server converts to/from the SolidWorks-internal metre/radian units at the boundary.
Architecture
src/solidworks_mcp/
binding.py early-binding plumbing (wrap raw dispatches in generated classes)
com_worker.py one dedicated STA thread; all COM calls serialised through it
session.py SolidWorks operations (must run on the COM thread)
server.py FastMCP tools that delegate to session via the worker
constants.py enum values read from the installed typelib (verified)
units.py mm<->m, deg<->rad
errors.py SolidWorksError -> agent-facing {ok:false,error}Two non-obvious design decisions, both load-bearing:
Early binding is mandatory. On this build
GetActiveObjectreturns a dispatch whoseGetTypeInfo()fails, soEnsureDispatch/CastTocannot infer types and pure late binding breaks (IModelDoc2.FirstFeature→DISP_E_MEMBERNOTFOUND). We generate makepy wrappers from the installed typelib and wrap each raw dispatch in the right interface class; calls then go by dispid viaInvokeTypes, bypassing name resolution. Seebinding.py.A dedicated COM thread. COM is STA and thread-affine. The MCP server runs on asyncio, so all COM work is pinned to one worker thread (
com_worker.py) that handlers post to and await — actively enforcing the "one COM session, single-threaded" rule that does not hold automatically in an async server.
Status and roadmap
Proven end-to-end against SOLIDWORKS 2026 (3DEXPERIENCE R2026x):
Milestone | What it proves | State |
M0 | COM connection to a running SolidWorks | ✅ |
M1 | new part → sketch rectangle → extrude → mass properties (volume matches hand calc) | ✅ |
M2 | change a named dimension → rebuild → volume changes predictably | ✅ |
M3 | full agent loop via the MCP server: build → measure → correct → export STEP/STL + screenshot | ✅ |
M4 | revolve, sweep, loft, profiles, holes/pockets/counterbores, slots, fillet/chamfer, shell, patterns, equations, materials, save/open | 🚧 ongoing |
M5 | end-to-end 3D-print part: build a functional mounting bracket through the full loop → verify every dimension → export a fine STL (scripts/m5_demo_bracket.py) | ✅ |
M6 | assemblies: insert and position components, mate them, check interference — every placement and mate measured back (tests/test_assembly.py) | ✅ |
See Docs/PROGRESS.md for the detailed log and roadmap. Feedback and contributions are welcome.
Known limitations
Geometry so far: boxes, cylinders/cones (revolve), arbitrary extruded profiles, holes, polygon pockets/slots (
cut_profile), fillets, chamfers, shells, linear + circular patterns (bolt circles); plus equations, materials, geometry inspection, and save/open of.sldprt, holes + pockets on any planar face (model→sketch transform), round flanges (disc + bore + bolt circle), and slotted holes (cut_slot, obround at any angle — the first arc-based sketch), general revolves (add_revolved_profile: any(r,z)profile → shafts, vases, rings), swept pipes/tubes (add_swept_pipe: a round profile along a rounded 2D path), and lofts (add_lofted_solid: blend stacked polygon profiles → transitions/adapters), free-form extrusions (add_extruded_spline: a smooth closed spline → organic/aesthetic outlines), and non-circular sweeps (add_swept_profile: any cross-section along a path → rails, gaskets, trim), and mirrors (add_mirror: features or the whole body about a plane through the part).Selection: plane walk, face-by-normal/direction (
_planar_face_by_normal,+z/…, with:innerfor the cavity side of a hollow part), and edge selection by axis or explicit index (_select_edges).list_faces/list_edgeslet an agent inspect geometry before selecting.Assemblies (M6): components, transforms, mates and interference detection. Component patterns, in-context features, configurations, drawings and Simulation (FEA) are out of scope.
Available Tools
88 toolsactivate_documentA
Make an open document current again by its title, also a new one that was never saved.
For after open_part / close_part on another document; list_documents gives the titles.
Inputs: title (required).
add_boss_on_faceB
Grow a round boss (standoff, peg) height_mm out of ANY planar face, centred at (x, y, z) mm.
The face is found as for add_hole_on_face. For a PCB standoff, add a blind
hole in its top. from_edges works as for add_hole_on_face. Returns mass
properties and dimensions.
Inputs: face (required), x_mm (required), y_mm (required), z_mm (required), +4 more.
add_boxA
Add a rectangular block: sketch width x height on the first plane, extrude by depth.
Dimensions are in millimetres. Returns the created feature name, the
addressable depth dimension ('D1@'), dimensions (width, height,
depth; for set_dimension) and the resulting mass properties.
Inputs: depth_mm (required), width_mm (required), height_mm (required), name.
add_chamferB
Chamfer edges of the current part: distance_mm back along a face, at angle_deg (default 45°) to it.
edges: "all" (default), "x"/"y"/"z", a face outline like "+z:outline", a feature's edges like "feature:Boss", or explicit indices like "2,5" from list_edges. Another angle than 45° needs from_face, which way the face that the distance runs along faces: "-z", angle_deg=60 makes an underside edge printable without support (round an arc the chamfer is a cone). Returns the number of edges chamfered and the mass properties.
Inputs: distance_mm (required), name, edges, angle_deg, +1 more.
add_circular_patternA
Repeat a feature count times evenly around 360° about an axis.
The axis is the cylindrical face nearest (center_x_mm, center_y_mm) — e.g. a centre hole drilled there. feature_name defaults to the last feature. Bolt circle: drill a centre hole + one bolt hole, then pattern the bolt hole.
Inputs: count (required), center_x_mm (required), center_y_mm (required), feature_name.
add_coneA
Create a cone/frustum by revolving a trapezoidal profile 360°.
top_diameter_mm = 0 gives a full cone. Returns mass properties (volume = π·h/3 · (rb² + rb·rt + rt²)). Use new_part first.
Inputs: height_mm (required), top_diameter_mm (required), bottom_diameter_mm (required), name.
add_counterbore_holeA
Cut a counterbored screw hole on the +Z face at (x_mm, y_mm).
A clearance shank through the thickness plus a larger coaxial flat-bottom pocket of cbore_depth_mm from the top — so a cap-head screw or heat-set insert sits flush/recessed (common for 3D-printed parts). cbore_diameter must exceed clearance_diameter. Coordinates share add_box's system. Returns mass properties.
Inputs: x_mm (required), y_mm (required), cbore_depth_mm (required), cbore_diameter_mm (required), +2 more.
add_cylinderB
Create a cylinder by revolving a profile 360° about an axis.
The first revolve-based primitive. Returns the resulting mass properties (volume = π · r² · h). Use new_part first.
Inputs: height_mm (required), diameter_mm (required), name.
add_discA
Create a disc/puck/flange: a circle extruded along +Z, centred at (x_mm, y_mm).
Flat faces are +Z/-Z, so add_hole and add_circular_pattern compose with it (round-flange bolt circles). The centre defaults to the origin; off it, its x and y are dimensions. Returns mass properties. Use new_part first.
Inputs: diameter_mm (required), thickness_mm (required), name, x_mm, +1 more.
add_extruded_profileA
Extrude a closed polygon into a solid: points_mm = [[x,y], ...] in mm.
The polygon (first-plane coordinates, same as add_box) is auto-closed and extruded by depth_mm. Unlocks arbitrary prismatic shapes (brackets, profiles, polygons). corner_radii_mm rounds the corners with real sketch fillets: one radius for all, or one per vertex (0 = sharp); equal radii share one dimension ('radius', else 'r'). rotate_deg turns the profile counterclockwise about about_mm ([x, y], the origin by default) first: draw a crank or a lug straight, then set it at its angle. draft_deg tapers the walls inwards as they rise (negative: outwards), a dimension 'draft' (a moulded boss, a printable taper). merge=False keeps the result a separate body: list_bodies, combine_bodies. Returns mass properties (volume = polygon area * depth; a right-angled corner of radius r loses r^2 (1 - pi/4), a concave one gains it).
Inputs: depth_mm (required), points_mm (required), name, merge, +4 more.
add_extruded_profile_on_faceB
Grow a polygon boss depth_mm out of ANY planar face: points_mm = [[x,y,z], ...] in mm.
The 3D points lie on the face (found as for add_hole_on_face). For pads, ledges and mounting blocks on an existing part. corner_radii_mm rounds the corners as for add_extruded_profile. Returns mass properties.
Inputs: face (required), depth_mm (required), points_mm (required), name, +1 more.
add_extruded_profile_on_planeB
Extrude a polygon drawn on a reference plane, such as one add_plane made at an angle.
points_mm = 3D [x, y, z] points ON the plane (origin + u x_axis + v y_axis from add_plane), or all [u, v] in that frame. depth_mm along the plane's normal, or the other way with reverse=True; merged with the part. corner_radii_mm, draft_deg and merge work as for add_extruded_profile. Returns mass properties.
Inputs: plane (required), depth_mm (required), points_mm (required), name, +4 more.
add_extruded_slotB
Extrude a stadium (rounded tab, lug or link) from point start_mm to end_mm ([x, y] mm).
The half-round ends are centred on the two points themselves; width_mm is the tab's width, depth_mm the extrusion along +Z. Volume = (width * length
pi * (width/2)^2) * depth. Returns mass properties.
Inputs: end_mm (required), depth_mm (required), start_mm (required), width_mm (required), +1 more.
add_extruded_splineA
Extrude a smooth CLOSED spline through points: points_mm = [[x,y], ...] in mm.
Like add_extruded_profile but the outline is a smooth curve through the points (free-form/organic shapes: cams, rounded outlines, aesthetic bosses), auto-closed and extruded by depth_mm. A spline's area is not analytic, so the returned volume is the measured value. Returns mass properties. Use new_part first.
Inputs: depth_mm (required), points_mm (required), name.
add_filletA
Round edges of the current part with one constant radius (mm).
edges: "all" (default), "x"/"y"/"z" for edges parallel to that world axis, a face outline like "+z:outline" (the outer edges of the top face, not those of holes in it), every edge of one feature like "feature:Boss" (its top and where it meets the part: a moulded look), or explicit indices like "2,5" from list_edges. radii_at_mm = [[x, y, z, r], ...] makes the radius vary: r at the edge end at each point (list_edges gives the ends), radius_mm at the other ends, straight in between; 'vertex_radii' gives each end's dimension. skip_shorter_mm leaves out edges shorter than that. tangent_propagation=True carries the round on along edges that run on smoothly from the given ones, as SolidWorks does by default: an edge ending where it runs into another tangentially, such as round a fillet, only rounds so. A refusal names the edges the radius does not fit (each tried alone, and with propagation). Returns the number of edges filleted and the mass properties.
Inputs: radius_mm (required), name, edges, radii_at_mm, +2 more.
add_full_roundB
Round a rib's top off completely: a full round fillet, as on a moulded part.
The face facing face ("+z", ...) through the point (x, y, z) is the top;
the two opposite flat side faces along it that lie closest together are the
sides, so the round runs across the rib, not along it. The radius is half
their distance (width_mm in the result) and follows the rib. Hand
calculation: a rib w wide and L long loses L w^2 (1/2 - pi/8).
Inputs: face (required), x_mm (required), y_mm (required), z_mm (required), +1 more.
add_holeA
Cut a circular through-hole at (x_mm, y_mm), through the part's depth axis.
The hole runs straight through the thickness (the add_box extrude direction), perpendicular to the width x height profile face. Coordinates share add_box's system (the centre of a 40x20 profile is x=20, y=10). Returns mass properties.
Inputs: x_mm (required), y_mm (required), diameter_mm (required), name.
add_hole_on_faceA
Drill a round hole on ANY planar face, centred at 3D point (x, y, z) mm.
face is "+x"/"-x"/"+y"/"-y"/"+z"/"-z": the face facing that way through the
point is drilled, so a pocket floor or a step works too. Through all, or
depth_mm deep (blind: heat-set inserts, screw pilots). Returns mass
properties and dimensions (diameter, x, y, depth). from_edges=True
measures x and y from the face's nearest straight edges instead of the
origin, so the hole keeps its distance to them when the part changes
(measured_from names the edges): use it where the design means it.
Inputs: face (required), x_mm (required), y_mm (required), z_mm (required), +4 more.
add_hole_wizardB
An ISO hole from SolidWorks' Hole Wizard, sized by its standard tables.
kind: 'clearance' (ISO 273), 'counterbore' (socket head cap screw),
'countersink' (socket countersunk screw) or 'tapped'; size e.g. 'M3'.
Centred at (x, y, z) mm on the face through that point; through all, or
depth_mm deep. fit: 'close' / 'normal' / 'loose'. For tapped holes
thread='modeled' cuts a real, printable ISO thread instead of SolidWorks'
cosmetic one. Returns the standard's sizes in hole and mass properties.
Inputs: face (required), kind (required), size (required), x_mm (required), +6 more.
add_linear_patternA
Repeat a feature count times, spacing_mm apart, along a direction.
direction: "+x"/"-x"/"+y"/... feature_name: the feature to repeat (e.g. "Hole"); defaults to the most recently added feature. Returns mass properties.
Inputs: count (required), spacing_mm (required), direction, feature_name.
add_lofted_solidA
Loft (blend) 2+ closed profiles on parallel planes stacked along +Z.
profiles_mm: per profile a polygon [[x,y],…] (mm) in Front-plane coords, or a round section {"center_mm": [x, y], "diameter_mm": d} (thick at the knee, thin at the foot, centres free to wander). heights_mm = the +Z offset (mm) of each profile, same length, strictly increasing, starting at 0. A 2-profile loft is a ruled transition; 3+ blend smoothly. Each profile starts at its first vertex (a round one on +x): give polygons in a consistent vertex order to avoid twist. Returns mass properties. Use new_part first.
Inputs: heights_mm (required), profiles_mm (required), name.
add_mateA
Mate a face of one component to a face of another.
comp_a/comp_b are component names ('Bed' or 'Bed-1'; 'Leg-1/Thigh-1' inside
a sub-assembly). face_a/face_b select a face in that component's OWN frame:
by direction "+x"/"-x"/"+y"/... (optionally "+y:inner" for the cavity side
of a hollow part), by its list_faces(component=...) index, "#5", or by a
point on it, "@x,y,z" (a hole's wall: its centre plus the radius along x).
mate_type between planar faces:
"coincident", "distance" (distance_mm), "parallel", "perpendicular" or
"angle" (angle_deg between the faces' normals, 0..180); "concentric" between
two cylindrical faces (a pin in a hole, a hinge axis), leaving the turn
about the axis free. flip takes the other solution: the mirror side of a
distance, the other turning direction of an angle. A distance or angle
mate returns its dimension: drive it with
set_dimension, or step it with check_motion. An angle mate's dimension
then turns the joint the whole way round, past 180 and below 0 (-30 is 30
the other way, the same turn as 330). The result is measured back
after the rebuild; a mate that does not hold is removed and the components
are put back.
Inputs: comp_a (required), comp_b (required), face_a (required), face_b (required), +4 more.
add_mirrorA
Mirror features, or the whole body, about the 'front'/'top'/'right' plane moved offset_mm.
Mirrors about z / y / x = offset_mm; plane may also name another plane in the part ('Plane1'), moved offset_mm along its normal. features: list_features names; the copies follow their seeds. Without features the body is mirrored and merged: model half of a symmetric part, mirror it about the face where the halves meet. The plane position comes back as dimension 'plane_offset'. Fails, leaving the part as it was, when a copy would land outside the part.
Inputs: plane (required), name, features, offset_mm.
add_planeA
Make a reference plane to sketch on: an offset or a turned plane, its position a dimension.
base moved offset_mm along its normal (base: front/top/right or a plane by name), or a default plane turned angle_deg about a model axis it holds, about='x'/'y'/'z' (front holds x and y, top x and z, right y and z), by the right-hand rule. For both, turn first, then offset that plane. Returns its name for plane= arguments, and origin_mm, normal, x_axis and y_axis: a point (u, v) on it is origin + u x_axis + v y_axis.
Inputs: base, name, about, angle_deg, +1 more.
add_revolved_profileA
Revolve a closed profile on the Front plane about an axis in it.
Without axis_mm: profile_mm = [[r, z], …] in mm, r = distance from the Y axis, z = position along it. With axis_mm = [[x1, y1], [x2, y2]]: profile_mm gives [x, y] points and the axis is the line through those two points, anywhere and at any angle (a hub turned about its own centre). Auto-closed and spun angle_deg (default 360°). Points on the axis give a solid (shafts, vases); a profile away from it gives a ring. The profile may not cross the axis. corner_radii_mm rounds corners as for add_extruded_profile (not those on the axis). Returns mass properties. Use new_part first.
Inputs: profile_mm (required), name, axis_mm, angle_deg, +1 more.
add_ribA
Add a straight stiffening rib / gusset in a plane parallel to the Front plane.
start_mm/end_mm = [x, y] ends of the rib's free edge (add_extruded_profile coordinates); the plane sits at height z_mm. The rib grows toward toward_mm (any [x, y] point on the side to fill, e.g. the inner corner of an L-bracket) until it meets the part, thickness_mm thick, centred on the plane. Returns mass properties: a triangular gusset with legs a and b adds a*b/2 * thickness.
Inputs: z_mm (required), end_mm (required), start_mm (required), toward_mm (required), +2 more.
add_shellA
Hollow the current part to a wall of thickness_mm, opening one face or more.
open_face: a direction "+z"/"-z"/"+x"/... removes that planar face (open shell), "#5" the face of that list_faces index, and a list ["+z", "#5"] opens several; "none" makes a closed hollow. Shell before cutting openings: a shell after them puts a wall along every cut edge. Returns the resulting mass properties.
Inputs: thickness_mm (required), open_face.
add_sketchA
Draw a sketch of lines, arcs and splines on a plane, fully defined, to extrude or cut.
plane: "front", "top", "right" or a plane by name (add_plane). Points are [u, v] in the plane's own axes, which the result gives (origin_mm + u x_axis + v y_axis): front is (x, y), top (x, -z), right (-z, y). The outline starts at start_mm; each segment runs on from where the last ended: {"line": [u, v]}; {"arc": [u, v], "through": [u, v]} (an arc through a middle point); {"arc": [u, v], "tangent": true} (an arc flowing on from the segment before); {"spline": [[u, v], ..., [u, v]]} (through the points, ending at the last). "tangent": true on a line checks that it flows on. End on start_mm to close the outline. Segments that meet smoothly get a tangent relation, the rest is dimensioned from the origin: x/y for the i-th point given (points_mm lists them; start_mm is 0), r for the radius of segment k. Then extrude_sketch / cut_sketch the returned sketch.
Inputs: plane (required), segments (required), start_mm (required), name.
add_swept_pipeA
Sweep a circular profile (pipe/tube/rod) along a 2D path on the Front plane.
path_mm = [[x, y], …] in mm is the centreline. Interior corners are rounded with bend_radius_mm (required when the path turns; a 2-point straight path needs none); smooth=True runs a spline through the points instead, a flowing curve. diameter_mm = outer Ø; the round profile is auto-generated perpendicular to the path. Returns mass properties (pi r^2 x path_length_mm). Use new_part first.
Inputs: path_mm (required), diameter_mm (required), name, smooth, +1 more.
add_swept_profileA
Sweep an arbitrary closed PROFILE (cross-section) along a 2D PATH.
profile_mm = [[u,v],…] in mm: the closed cross-section on the Right plane (u → world -Z, v → world +Y), centred near the origin. path_mm = [[x,y],…] in mm on the Front plane — MUST start at the origin heading +X (the profile is perpendicular to the path there). Path corners are rounded with bend_radius_mm; corner_radii_mm rounds the profile's corners as for add_extruded_profile. Volume = profile_area · path_length. For non-round extrusions along a path (rails, gaskets, trim, channels). Returns mass properties. Use new_part first.
Inputs: path_mm (required), profile_mm (required), name, bend_radius_mm, +1 more.
add_text_on_faceA
Engrave text into ANY planar face, or emboss it with emboss=True (labels, version numbers).
(x, y, z) is the text's lower-left corner on the face; the text runs along the face sketch's horizontal axis: upright along +x on the top (+z) and front (-y) faces, turned on the others (vertical on +/-x, upside down on +y), so put labels on the top or front. height_mm is the character height, depth_mm the engraving depth or embossing height. The position is two dimensions ('x', 'y'); font must be installed (default: SolidWorks' own). Returns text_area_mm2, since letters have no hand calculation.
Inputs: face (required), text (required), x_mm (required), y_mm (required), +6 more.
add_threadA
Cut a real, printable ISO metric thread (SolidWorks' own Thread feature).
size: e.g. 'M10x1.5', 'M3x0.5', 'M10x1.0' -- checked against SolidWorks' thread profiles. (x_mm, y_mm, z_mm) = centre of the circular edge where the thread starts: the end face of a rod, or the mouth of a hole (internal=True). It runs length_mm into the material, right-handed. External: the rod must have the nominal diameter (M10 -> Ø10). Internal: drill the ISO basic minor diameter first, D - 1.0825*P (M10x1.5 -> Ø8.376). Returns mass properties and the thread's size, pitch and diameters.
Inputs: size (required), x_mm (required), y_mm (required), z_mm (required), +3 more.
check_interferenceA
Report component pairs whose solids overlap, with the volume in mm^3.
Touching faces do not count (a bed standing on the floor is fine); only real overlapping material does. count == 0 means the assembly is clash-free.
Inputs: no named parameters.
check_motionA
Step a joint through its range and check the assembly at every step.
dimension_name: an angle or distance mate's dimension (add_mate returns it); values in degrees for an angle, mm for a distance, e.g. [30, 60, 90, 120, 150]. Each step gives the overlapping pairs with their volume and the distance between each pair in distances ([["Rod", "Bolt"], ...]); the summary gives clash_free and each pair's smallest distance with the value where it occurs. The dimension goes back to its value afterwards. A joint inside a sub-assembly is 'D1@Angle1@Leg-1'. Refused while a mate is broken: the parts it should hold would drift and the result mean nothing.
Inputs: values (required), dimension_name (required), distances.
check_printabilityA
Check the current part for 3D printing, built along up ('+z', '-y', ...).
Overhangs: downward faces leaning more than overhang_deg from vertical (90 =
a flat ceiling) need support; the faces on the bed do not count. Gives the
overhanging area per face (list_faces index) with its worst lean and centre,
the bed contact area and the print height. Islands: each place where the
print starts in the air, its height above the bed, centre and faces; a
downward edge between faces too steep to overhang still needs support
there. Unsupported edges: stretches of such an edge with air below, also
where the rest of it rests on material (the ends of a chamfered pad's edge
beside a tube), with length, height, centre and faces. With min_wall_mm (e.g. two
nozzle widths) also the walls thinner than that, measured straight through
the material from points spread over every face, with where each is thinnest;
that stops after a minute on a detailed part, and rays then says how much
it measured.
A spot right beside an edge where faces meet at a sharp angle reads as thin
as the wedge of material there is: that is the edge, not a wall.
Inputs: up, min_wall_mm, overhang_deg.
close_partA
Close the current part or assembly without saving (export/save first if needed).
With no current document it closes SolidWorks' active one, but only when that has no unsaved changes.
Inputs: save.
combine_bodiesA
Combine solid bodies of the part into main (a list_bodies name).
operation 'add' joins the tools to main, 'subtract' cuts them out of it, 'common' keeps only what main shares with them. tools: body names, every other body by default. Returns mass properties and the bodies left.
Inputs: main (required), operation (required), name, tools.
compare_with_meshB
Compare the current part's cross-sections with a reference mesh's at the same heights.
offset_mm [dx, dy, dz] moves the mesh into the part's frame. A different area means a misread feature; equal areas with different extents a shifted frame. Returns per-section pairs and the worst differences.
Inputs: axis (required), path (required), heights_mm (required), frame, +1 more.
cut_offset_pocketA
Pocket a planar face, leaving a rim rim_mm wide along its outline.
The recessed web of an I-beam that follows a curved link, a tray, or a frame
(depth_mm omitted: through all). The face is the one facing face
('+z', ...) through the point (x, y, z). The rim follows the outline, arcs
and splines included; holes in the face stay holes. rim and depth come back
as dimensions, and the pocket follows the outline when it changes. Returns
mass properties.
Inputs: face (required), x_mm (required), y_mm (required), z_mm (required), +3 more.
cut_profileA
Cut a polygonal pocket/slot from the +Z face: points_mm = [[x,y], ...] in mm.
Auto-closed polygon, cut blind by depth_mm or all the way through when depth_mm is omitted. For pockets, slots, cutouts. corner_radii_mm rounds the corners and rotate_deg turns the profile about about_mm, as for add_extruded_profile (notches at +/-60 degrees around a pivot). Returns mass properties.
Inputs: points_mm (required), name, about_mm, depth_mm, +2 more.
cut_profile_on_faceA
Cut a polygon pocket/slot on ANY planar face: points_mm = [[x,y,z], ...] in mm.
The 3D points must lie on one face facing face ("+x"/"-x"/...), which is
found through them; cut blind by depth_mm or through when omitted. For side
pockets/cutouts. corner_radii_mm rounds the corners as for
add_extruded_profile. Returns mass properties.
Inputs: face (required), points_mm (required), name, depth_mm, +1 more.
cut_profile_through_planeA
Cut a polygon sketched on a reference plane, symmetric about that plane.
plane: 'front' (z = 0), 'top' (y = 0), 'right' (x = 0) or the name of another plane in the part ('Plane1'); points_mm = 3D [x, y, z] points ON that plane (e.g. x = 0 for 'right'), or all [u, v] in the plane's own frame (as add_plane and add_sketch give it). Cuts through all in both directions (depth_mm omitted) or depth_mm in total, centred on the plane. For shapes seen from the side: wedges, windows, symmetric recesses. corner_radii_mm rounds the corners as for add_extruded_profile. keep_inside=True cuts away everything OUTSIDE the profile (through all): extrude the front view, cut the side view with keep_inside, and the part is the 3D shape both views agree on. Returns mass properties.
Inputs: plane (required), points_mm (required), name, depth_mm, +2 more.
cut_sketchA
Cut an existing sketch of the current part by name into the body.
depth_mm deep, or through all when depth_mm is omitted, against the sketch's normal: into the part from a face. From a plane with the part in front of it (a box on the Front plane) give reverse=True. Returns mass properties.
Inputs: sketch (required), name, reverse, depth_mm.
cut_slotA
Cut a straight slotted hole (obround) on the +Z face.
Centred at (x_mm, y_mm); length_mm is centre-to-centre of the rounded ends, width_mm the slot width, angle_deg its orientation in the +Z plane (0 = +X). Cut blind by depth_mm or through when omitted. Returns mass properties.
Inputs: x_mm (required), y_mm (required), width_mm (required), length_mm (required), +3 more.
delete_componentA
Remove a component from the current assembly, with the mates that hold it.
component: its name in list_components ("Bracket-1", or "Bracket" while there is one). Returns the mates deleted, the components left and the assembly's mass properties.
Inputs: component (required).
delete_equationA
Delete an equation by the name it sets ("L_thigh", "D1@Boss") or its list_equations index.
Rebuilds and returns what was deleted, failing_features and mass properties.
Inputs: equation (required).
delete_featureA
Delete a feature (a list_features name) with its sketch, then rebuild and remeasure.
The way to undo a step. Refuses when other features are built on it and names them, and what is built on those; with_children=True deletes them all. dry_run=True only lists what would go (would_delete). Equations that named its dimensions break and come back as broken_equations; with_equations=True deletes them (global variables stay).
Inputs: name (required), dry_run, with_children, with_equations.
delete_mateA
Delete a mate of the current assembly by name (list_components, or add_mate's 'mate').
Its components are free to move again. Returns the mates left.
Inputs: name (required).
exportA
Export the current part or assembly to STEP/STL/IGES/Parasolid/3MF (format from extension).
Silent (no prompts). Verifies the file appears on disk and reports its size.
For STL/3MF, tessellation resolution is set first: quality 'coarse'|'fine'
(default 'fine' for print quality), or pass deviation_mm (+ optional angle_deg)
for a reproducible custom resolution (overrides quality). Ignored for other formats.
An assembly goes to STL as one file, or one file per component with
per_component=True (SolidWorks names them); files lists what was written.
STL/3MF keep the part's or assembly's own coordinates (frame), also per
component, so a mesh measures back where the model is; slicers place it anyway.
Inputs: path (required), quality, angle_deg, file_format, +2 more.
extrude_sketchA
Extrude an existing sketch of the current part by name, e.g. one a person drew.
depth_mm along the sketch's normal (reverse=True: the other way), merged with the body. Or up_to='next': up to the next face of the part, ending on its shape (a post into a curved wall) and following it when it changes; or up_to='@x,y,z': up to the face through that point, also where 'next' fails (a side of the profile on a face: the refusal names a point ahead). The sketch keeps its own dimensions and relations, so the person's design stays in charge; read_sketch shows it first. Returns mass properties.
Inputs: sketch (required), name, up_to, reverse, +1 more.
get_assembly_bounding_boxA
Get the bounding box of the whole assembly (min/max/size in mm).
Inputs: no named parameters.
get_bounding_boxA
Get the tight bounding box of the current part (min/max/size in mm).
Inputs: no named parameters.
get_mass_propertiesA
Get volume (mm^3), mass (kg), surface area (mm^2), centre of mass, and bounding box.
Inputs: no named parameters.
get_statusA
Report whether SolidWorks is reachable, its revision, this server's version, and the active/current part.
Inputs: no named parameters.
insert_componentA
Insert a .sldprt, or a .sldasm as a sub-assembly, with its ORIGIN at (x, y, z) mm.
The part's own origin lands exactly on that point, and the placement is read back and verified. fixed=True pins the component; fixed=False leaves it free for mates. The default fixes only the FIRST component, giving the assembly a ground to build against. Returns the component's name, placement and box.
Inputs: path (required), x_mm, y_mm, z_mm, +1 more.
list_bodiesA
List the part's solid bodies: name, volume and bounding box.
A part holds several after merge=False or split_body; combine_bodies joins them again.
Inputs: no named parameters.
list_componentsA
List the assembly's components (name, path, fixed, position, rotation, bounding box) and mates.
Positions are in mm and rotations in degrees, both in assembly coordinates;
the bounding box of each component is in assembly coordinates too. Each
mate gives its name, SolidWorks type, the dimension of a distance or angle
mate, and an error when SolidWorks flags it. A component that shows no
geometry carries a problem (see replace_component).
Inputs: no named parameters.
list_dimensionsB
List every dimension in the current part: name (for set_dimension), feature, value, unit.
For a part opened from disk, or when the names the tools returned are gone. contains (e.g. 'Sketch3' or 'Pad') keeps those whose name or feature holds that text; use it on a large part, whose full list is too long to read.
Inputs: contains.
list_documentsA
List the documents open in SolidWorks: title, path (empty until saved), type, unsaved changes.
current marks the one the tools work on, active SolidWorks' own. Parts
an open assembly loaded come along, with visible false.
Inputs: no named parameters.
list_edgesA
List the part's edges: index, type, length, ends; lines also axis and midpoint.
Narrow it on a big part: face (a list_faces index, "#5"), feature (the edges of the faces it made), within_mm ([[x1, y1, z1], [x2, y2, z2]]: both ends inside), min_length_mm. Indices are always those of the whole part: use them with add_fillet/add_chamfer edges="2,5".
Inputs: face, feature, within_mm, min_length_mm.
list_equationsA
List the equations and global variables: index, equation, name it sets, value, global.
broken marks an equation that names a dimension or variable that is gone,
as one left behind by delete_feature; delete_equation removes it.
automatic_solve_order False means SolidWorks solves them as listed: one
above the line that sets its variable then warns and lags a rebuild. Any
set_equation turns it on.
Inputs: no named parameters.
list_facesA
List the part's faces (index, planar?, normal, area, centre) for inspection.
A cylindrical face also gives its axis, radius and a point on the axis (for a hole: its centre), so hole patterns can be read off. component: a component of the current assembly, listed in its own frame (e.g. an imported servo); for a sub-assembly, every part's faces in the sub-assembly's frame, each naming its part. A part's indices shift as features are added; a component's are ordered by part, type, centre and area, so they stay while its shape does. add_mate takes them as '#5'.
Inputs: component.
list_featuresA
List the current part's modelling history in tree order: name, type, suppressed.
For a part opened from disk, or to find the step to undo. Flags features that fail to rebuild and names sketches that are not fully defined.
Inputs: no named parameters.
loft_sketchesA
Loft through 2+ closed sketches of the current part, by name, in order.
The sketches may lie on any planes (add_plane, then add_sketch on it, or a person's sketches), so the loft runs in any direction, unlike add_lofted_solid's stack along +Z. Start each sketch at the matching corner (its first segment's start) to keep the loft from twisting. Returns mass properties.
Inputs: sketches (required), name.
make_drawingA
Make a 2D drawing of the current part: a PDF, or an editable .slddrw.
Front, top and right views in European (first angle) projection plus an isometric view, on an A4 sheet at the scale SolidWorks picks, with the model's own dimensions, each shown once: a dimensioned sketch to print or send. Save the part first (save_part): the drawing refers to its file.
Inputs: path (required).
measure_distanceA
The smallest distance (mm) from a component to another one, a point or an axis.
Give component_b; or point_mm = [x, y, z] in assembly mm, and the nearest point on the component comes back too, with inside: true when the point lies in its material; or axis_mm = [[x, y, z], [dx, dy, dz]], the endless line through that point along that direction, such as a bolt's axis. 0 means they touch or overlap; check_interference tells which. Sub-assemblies count with all their parts; one part inside is 'Leg-1/Thigh-1'.
Inputs: component_a (required), axis_mm, point_mm, component_b.
new_assemblyA
Create a new empty assembly document; it becomes the current document.
Assemblies compose saved parts: insert_component places each part, add_mate constrains them, check_interference proves nothing overlaps.
Inputs: no named parameters.
new_partA
Create a new empty part document; it becomes the current part.
Inputs: no named parameters.
open_assemblyA
Open a .sldasm, or import a STEP/IGES/Parasolid assembly; it becomes the current document.
An imported assembly's parts arrive as components at their places, ready for list_components and add_mate; the result gives the component count. A file holding a single part is refused (use open_part), and an import over 30 MB unless allow_large=True (it can outlast the 2-minute call limit).
Inputs: path (required), allow_large.
open_partA
Open a .sldprt, or import a STEP/IGES/Parasolid file as a new part; it becomes the current part.
list_features shows its history, list_dimensions its dimensions. An imported body has no history, but the tools work on it (holes and pockets on its faces, bosses, fillets); an import returns its solid body count and mass properties. A file holding an assembly is refused, and an import over 30 MB unless allow_large=True (it can outlast the 2-minute call limit).
Inputs: path (required), allow_large.
read_sketchA
Read a sketch of the current part back, e.g. one a person drew (a list_features name).
Gives its lines, arcs, circles and splines in MODEL coordinates (mm), construction geometry marked, its dimensions (for set_dimension) and whether it is fully defined: check a design against fixed points before building on it with extrude_sketch / cut_sketch.
Inputs: name (required).
rebuildB
Force a rebuild of the current part or assembly and report whether it rebuilt without errors.
In an assembly, mate_errors names each mate SolidWorks flags, and each mate that lost a face or edge it used (it rebuilds fine, but holds nothing).
Inputs: top_only.
reorder_featureA
Move a feature (a list_features name), with its sketch, to just before another one; rebuild and remeasure.
For a boss added last that filled holes cut earlier: build it at the end as usual, then move it before the first of those cuts, and they cut through it again. Reference planes and axes it is built on move along (moved_along); refused, the part as it was, when it is built on another feature at or after that place. Returns the new order (features) and the features that fail to rebuild (failing_features).
Inputs: name (required), before (required).
replace_componentA
Put another part or assembly file in the place of a component of the current assembly.
Keeps its position and, with reattach_mates, its mates where they still
find their faces; mate_errors lists the ones that do not. Also the cure
for a component that vanished after its part was made anew under the same
path. Returns the new component (name, path, placement, bounding box).
Inputs: name (required), path (required), reattach_mates.
save_assemblyC
Save the current assembly to a native .sldasm file (so it can be reopened).
Inputs: path (required).
save_partA
Save the current part to a native .sldprt file (so it can be reopened/edited).
Inputs: path (required).
screenshotA
Save a screenshot of the current part or assembly (PNG/JPG/TIF).
view: 'iso' (default), 'front', 'back', 'left', 'right', 'top' or 'bottom'; or from_dir = [x, y, z], the direction to look from, e.g. [-1, 1, -1] to see from behind and below what iso hides (the model's +y stays up). Zoomed to fit, or onto a detail: zoom_mm = [[x1, y1, z1], [x2, y2, z2]], the corners of the region to fill the image (model mm, in any view). Reference planes and axes are left out, so they do not cut through the shape; show_planes=True keeps them.
Inputs: path (required), view, zoom_mm, from_dir, +1 more.
set_appearanceA
Colour and/or see-through of the current part, or of one component in an assembly.
rgb: [r, g, b], 0..255 each; transparency: 0 solid .. 1 clear (0 makes a see-through component solid again). In an assembly, component names it ('Bracket-1', 'Leg-1/Thigh-1'); the colour then belongs to the assembly and the part keeps its own. What is left out stays as it was.
Inputs: rgb, component, transparency.
set_component_transformA
Move/rotate a component: its origin to (x, y, z) mm, rotated rx/ry/rz degrees.
name is the component name ('Bed' or 'Bed-1'); rotations apply X, then Y, then Z about the assembly axes, and work on a fixed component too. The transform is read back and compared, so a move SolidWorks ignored (e.g. one already pinned by mates) fails loudly instead of silently leaving the part where it was.
Inputs: name (required), x_mm (required), y_mm (required), z_mm (required), +3 more.
set_dimensionA
Set a named driving dimension (e.g. 'D1@BlockExtrude') in mm, rebuild, and remeasure.
This is the parametric edit at the heart of the correction loop. The result's
broken_features names the features that fail since the change (a later cut
now off the part, a split whose bodies moved): fix or undo them first. Every
modelling tool returns its dimensions by role in dimensions. An angle (a
revolve, an angle mate) takes degrees; list_dimensions shows the unit. A
point's coordinate from the origin (a sketch's 'x3', 'y2') takes a sign,
-5 being across the origin; any other length is a size, refused below 0.
A value SolidWorks does not take (a dimension an equation drives, a size
of 0) is refused with the reason, and the part is left as it was.
Inputs: value_mm (required), dimension_name (required).
set_equationA
Add an equation, or replace the one that sets the same name; rebuild and remeasure.
A SolidWorks equation string, e.g. '"D1@BlockExtrude" = 25' or '"D1@BlockExtrude" = 2 * "D1@Sketch1"'. A global variable is '"W" = 40'; link a dimension to it with '"width@Sketch1" = "W"', and set '"W" = 45' again to change it. Persists a relation (unlike set_dimension). Returns the index, whether it replaced one, the features that fail to rebuild (failing_features) and mass properties.
Inputs: equation (required).
set_equationsA
Add or replace a list of equations at once, with one rebuild at the end.
As set_equation for each, in order (later ones may use earlier ones). A refused equation undoes the whole list. Returns per equation its index and whether it replaced one, failing_features and mass properties.
Inputs: equations (required).
set_materialA
Assign a material by name (e.g. "6061 Alloy", "AISI 1020", "ABS").
Makes mass and density reflect a real material instead of the 1000 kg/m³ default. One SolidWorks does not have (say "TPU") comes with its density: density_kg_m3=1210 makes it, by that name, carrying only the density. The English names work on a SolidWorks in another language too. Returns mass properties including density.
Inputs: name (required), database, density_kg_m3.
slice_meshA
Cross-sections of an STL/3MF mesh at the given heights along axis 'x'/'y'/'z'.
For modelling a part that must fit something that only exists as a mesh. Returns each section's closed loops, largest first, as polygon points (mm) ready to use as profiles. frame (3MF): 'object' (the mesh's own frame) or 'build' (as placed on the slicer's plate). Needs no SolidWorks.
Inputs: axis (required), path (required), heights_mm (required), frame.
split_bodyA
Split the part's body in two along a plane (front/top/right or a plane by name).
The two bodies come back by name: combine them differently, or check each with list_bodies. Use add_plane first for a cut anywhere else.
Inputs: plane (required), name.
suppress_featureA
Suppress a feature, or bring it back with suppress=False; rebuild and remeasure.
Keeps the feature and its dimensions, unlike delete_feature, so it suits trying a variant. Features that depend on it follow both ways.
Inputs: name (required), suppress.
suppress_mateA
Suppress a mate so it stops holding its components (it stays in the tree), or bring it back.
suppress=False brings it back. Returns whether it is suppressed now.
Inputs: name (required), suppress.
swept_regionA
Outline what a component covers in a plane while a joint moves, to keep clear of it or cut it away.
Steps the joint's dimension through values (as check_motion, e.g. every 5 degrees over 30..150), cuts the component at axis = each of heights_mm (a few heights inside a layer, not on its faces) and joins all of it, made margin_mm wider, within about tolerance_mm. frame: the component to give the coordinates in, such as the part to cut from; else the assembly's. Each region's outline runs counter-clockwise in the plane's other two axes, (x, y) across z: give it to add_sketch as a spline. count says how many separate regions there are.
Inputs: values (required), component (required), dimension (required), heights_mm (required), +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 88 tools
The descriptions are exceptionally detailed and each tool carves out a niche (e.g. add_hole vs add_hole_on_face vs add_hole_wizard vs add_counterbore_hole differ by coordinate system, face targeting and standard tables), but the sheer number of near-sibling families (add_extruded_profile / _on_face / _on_plane / _spline / _slot, cut_profile / _on_face / _through_plane, add_disc / add_cylinder / add_cone) makes misselection a real risk. An agent must read long descriptions carefully to pick the correct variant. Boundaries exist but they are dense and numerous.
Overwhelmingly consistent verb_noun snake_case (add_*, cut_*, list_*, set_*, get_*, delete_*, check_*, save_*), with predictable suffixes for variants (_on_face, _on_plane). Minor deviations: bare-verb tools (export, screenshot, rebuild) and a few noun-style names (swept_region, make_drawing instead of add_drawing).
88 tools is far beyond the 15-25 range that keeps a surface navigable; while CAD is a genuinely huge domain, the surface is fragmented into many single-purpose primitives and variants that could be parameterized or consolidated (five extrusion tools, four hole tools). The count imposes heavy selection cost on the agent.
Coverage is unusually thorough: document lifecycle, parametric sketching/features, equations, assemblies with mates and motion checks, mass properties, export/screenshot/drawing, and even printability and mesh comparison. Minor gaps remain (no component visibility/hide, no configurations, limited drawing editing), but no core workflow is a dead end.
Maintenance
Related MCP Connectors
Parametric 3D CAD for AI agents: build print-ready parts, check them, export STL, 3MF or STEP.
CAD in ChatGPT and Claude: editable parts, STEP/STL/drawings, in-chat 3D, automatic checks.
Text-to-CAD: build exact STEP or 3MF/STL on the server, each stated requirement measured.
A browser 3D CAD for your AI: it scripts real-size models, uCAD builds them and returns pictures.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to control a running SOLIDWORKS session through its COM API, with tools for sketching, feature creation, assemblies, and visual feedback via screenshots.22Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to build, measure, verify, and correct parametric SolidWorks parts and assemblies locally via the COM API, supporting operations like sketching, extruding, modeling, dimensioning, material assignment, export, and assembly mating.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents such as Claude to drive SolidWorks through its COM API using natural language, creating parts and assemblies, sketching geometry, and adding features without clicking menus. Also supports running arbitrary API scripts and verifying results through model reports, rendered views, interference checks, and exports.1MIT
- AlicenseBqualityBmaintenanceEnables AI agents to create and edit parametric SolidWorks parts and assemblies, measure resulting geometry, and iteratively verify their work against specifications.9150 PyPI2MIT