Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PYTHONUTF8NoPython UTF-8 mode; the README's Codex MCP configuration sets this to "1".
PYTHONIOENCODINGNoPython I/O encoding; the README's Codex MCP configuration sets this to "utf-8".
PYTHONUNBUFFEREDNoPython unbuffered mode; the README's Codex MCP configuration sets this to "1".
SOLIDWORKS_MCP_TOOL_MODENoSet to "search" to expose only four entry tools instead of the full list of 150+ tools. Removing this environment variable restores the full tool list.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

SolidWorks MCP server: drive SolidWorks parts, assemblies and drawings.

  • Start with get_model_info (or list_open_documents) to see what is open.

  • Build in this order: create_part, create_sketch, draw (add_rectangle, add_circle, ...), exit_sketch, then the feature (create_extrusion, create_cut_extrude, create_revolve). Features use the sketch sketch_name names, or the one you closed last.

  • Fillets and chamfers on a solid go last: add_fillet and add_chamfer after every boss and cut, at the end of the feature tree.

  • Inputs are millimetres and degrees unless a field says metres.

  • A tool's success does not prove the geometry is right: finish a build with verify_model, giving the size, volume or counts you expect.

  • A tool whose description starts "Not available yet" returns not_supported; use the tool it names instead.

  • On an error, read error_type and hint; rebuild_model names failing features and undo steps back.

Full guidance (workflows, selection, units, known limits): read the resource skill://solidworks-mcp/SKILL.md.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
open_modelA

Open a part, assembly or drawing from disk and make it the active document.

Use it to start work on an existing file. To switch to a document that is already open, use activate_document. Needs: the file on disk (a vault file must be checked out). Changes: opens the document; nothing is written. Returns: model with title, type, path and configuration.

create_partA

Create a new, empty part document and make it active, ready for create_sketch.

Uses template (a .prtdot) or the default part template, then sets units if given, and assigns material if given. The part is not saved until save_file. Needs: SolidWorks running. Changes: opens a new part document. Returns: part with name, units, template and material (the one assigned, or null), plus a warning when the material couldn't be assigned; the part is created either way.

create_assemblyA

Create a new, empty assembly document and make it active, ready for insert_component.

Uses template (an .asmdot) or the default assembly template. It is not saved until save_file. Needs: SolidWorks running. Changes: opens a new assembly document. Returns: assembly with name and template. Then call insert_component for each part.

create_drawingA

Create a new, empty drawing document and make it active.

Uses template (a .drwdot) or the default drawing template. Then place views with create_drawing_view; for a whole drawing from a model in one call, use generate_drawing_package instead (both in the drawing toolset). Needs: SolidWorks running. Changes: opens a new drawing document. Returns: drawing with name and template.

close_modelA

Close the active document, saving it first only if asked.

Use it when you are done with a document. Unsaved changes are lost unless save is on. Needs: an open, active document. Changes: closes the document, and with save writes it first. Returns: saved, whether a save was asked for.

create_extrusionA

Extrude the sketch you just closed into a solid boss, added to the active part.

Use it after exit_sketch; to remove material, use create_cut_extrude. It extrudes the sketch sketch_name names, or the one exit_sketch closed last; a name that isn't in the feature tree fails before anything is built. End conditions: Blind (default), MidPlane, ThroughAll, UpToNext; both_directions means MidPlane. With thin_feature and thin_thickness it makes a wall from the sketch's outline, and an open chain works (a bent plate from its centreline). Needs: an open part and a closed profile (open is fine when thin). Changes: adds a Boss-Extrude feature. Returns: extrusion (name, sketch when one was named, depth, the end_condition SolidWorks used, both_directions, and thin when thin) and measured_change (volume, bounding box and solid-body count before and after; left out when the model can't be read).

create_revolveA

Revolve a closed sketch around an axis, adding a solid to the active part.

Use it for turned shapes (shafts, knobs). It revolves the sketch sketch_name names, or the one exit_sketch closed last, about the reference axis axis_entity names (from create_axis), or about the centreline drawn in the sketch with add_centerline. A sketch or axis that isn't in the model fails before anything is built. Needs: an open part and a closed profile with a centreline or a reference axis. Changes: adds a Revolve feature. Returns: revolve (name, sketch and axis_entity when named, angle) and measured_change (volume, bounding box and solid-body count before and after; left out when the model can't be read).

get_dimensionA

Read one dimension of the active model by its full name, e.g. "D1@Sketch1".

Find names with list_model_dimensions. It reads the active configuration's value; activate_configuration to read another. Needs: an open part or assembly. Read-only. Returns: dimension with name, value and units: "mm" for a length, "deg" for an angle, and null for a count (such as a pattern's instance count).

set_dimensionA

Change one length dimension of the active model, in mm, and rebuild.

Use it to resize an existing model; find the full name with list_model_dimensions and check the result with rebuild_model or verify_model. The value is always millimetres. It changes the active configuration only, unless configurations is "all" or a list of names. Needs: an open part or assembly. Changes: the dimension and the geometry it drives. Returns: dimension_update with name, old_value, new_value and configurations (the names it was set in).

set_unitsA

Set the active document's length units: mm, cm, m, in or ft.

Use it on a new part before sketching if you want other than the template's units. Aliases such as "inch" are accepted. The setting is read back, so success means it applied. Tool inputs stay in mm whatever the document shows. Needs: an open, active document. Changes: the document's unit system. Returns: data with unit_system, the values applied and observed, and verified.

create_cut_extrudeA

Cut material from the active part with a closed sketch profile: holes, slots, windows.

Use it after exit_sketch. Pass sketch_name unless the sketch you just closed is the one: with no name only that sketch is used, and any doubt is an error naming the sketches found. A one-way cut that finds no material is retried the other way (direction_flipped). For a sketch inside the body, use ThroughAllBoth. Needs: an open part with a solid body. Changes: adds a Cut-Extrude feature. Returns: cut_extrude (name, sketch_name, direction_flipped) and measured_change (volume, bounding box and solid-body count before and after; left out when the model can't be read).

add_filletA

Round edges of the active part with a constant-radius fillet.

Name the edges as "Edge<1>", a point "x,y,z" (metres) or "face:x,y,z" for every edge of a face; or leave edge_names empty to use the current selection (e.g. from select_face_edges). A fillet that leaves the volume unchanged is an error. Needs: an open part with a solid body. Changes: adds a Fillet feature. Returns: fillet with name, radius and edges.

add_chamferA

Bevel edges of the active part with a chamfer: distance along one face at angle (45 by default).

Name the edges as "Edge<1>", a point "x,y,z" (metres) or "face:x,y,z" for every edge of a face; or leave edge_names empty to use the current selection (e.g. from select_face_edges). At 45 degrees both legs equal distance; at another angle, flip swaps which face distance is measured on. Needs: an open part with a solid body. Changes: adds a Chamfer feature. Returns: chamfer with name, distance, angle, flip and edges.

create_sweepA

Sweep a closed profile sketch along a path sketch to make a solid (Insert > Boss/Base > Sweep).

Draw the closed profile and the open path as two sketches first. The profile is the sketch you closed last that isn't the path. Needs: an open part with both sketches. Changes: adds a Sweep feature. Returns: sweep with name, path, twist_along_path and twist_angle.

create_loftA

Loft a solid through two or more closed profile sketches, in order (Insert > Boss/Base > Loft).

Use it for shapes that change section, such as a wing or a transition duct. Put each profile on its own plane (see create_reference_plane). Needs: an open part with the profile sketches. Changes: adds a Loft feature. Returns: loft with name, profiles and guide_curves.

insert_componentA

Insert a part or sub-assembly file into the active assembly at a position in mm.

Use it after create_assembly, then position components with add_mate. The file must contain solid geometry; an empty or missing file is an error. Needs: an open, active assembly and the file on disk. Changes: adds a component. Returns: component with its instance name (component, which add_mate takes), file_path, position and the counts before and after.

add_mateA

Mate two components of the active assembly: coincident, concentric, parallel, perpendicular, tangent, distance or angle.

Each side is a named reference plane or axis (entity_a, e.g. "Front Plane"), or a face given by a point on it (face_a, mm, in that part's own coordinates): a pin's round face and a hole's face make a concentric mate. Get instance names from list_components. Needs: an open assembly with both components. Changes: adds a mate and may move components. Returns: mate with mate_type, components, entities, geometry_moved and moved_components.

set_component_stateA

Fix or float an assembly component, make a sub-assembly flexible, or hide it or make it transparent.

Float a part so mates can position it (the first part inserted is fixed); fix one to hold it still. Make a sub-assembly flexible so its own mates move in this assembly (a crank whose knob turns). Hide a component (visible false) or make it transparent to see the parts inside. Only what you pass changes: the component's suppression, configuration and other states are kept. Needs: an open assembly. Changes: the states you pass. Returns: state with component, before and after (fixed, flexible, visible and the properties kept), and appearance (visible, transparent) when you changed it.

list_componentsA

List the top-level components of the active assembly by instance name, e.g. "bracket-1".

Use it before add_mate, which takes these names. Needs: an open, active assembly. Read-only. Returns: components (instance names).

delete_featureA

Delete a feature or sketch from the active model, along with the features that depend on it.

Ask the user before you call it: deleting a sketch also deletes every feature built from it (a cut, a boss), and deleting a feature deletes everything that depends on it. Use suppress_feature instead when you might want it back. Find names and dependents with list_features. Needs: an open part or assembly. Changes: removes the feature and its dependents (undo can restore them). Returns: data with deleted, removed_features (every feature that went, dependents included), features_before and features_after; the message names the dependents, and a warning says so whenever more than the named feature went: tell the user.

suppress_featureA

Suppress or unsuppress a feature of the active model; suppressed features stay in the tree but are not built.

Use it to turn off a feature that breaks the rebuild without deleting it. It acts in the active configuration only, unless configurations is "all" or a list of names. Needs: an open part or assembly. Changes: the feature's suppression state, and its children's. Returns: data with feature, requested, suppressed (read back in the active configuration; null when unreadable), was_suppressed and configurations (where it applied).

rename_featureA

Rename a feature in the active model's feature tree.

Use it to give features meaningful names (e.g. "MountingHoles"). The new name is read back: a name another feature already uses is an error. Renaming to the current name succeeds with no change. Needs: an open part or assembly. Changes: the feature's name. Returns: data with old_name, new_name, renamed and, when unchanged, reason.

select_featureA

Select a feature, sketch, plane or component by name in the active document.

Use it to set up a selection that the next SolidWorks operation acts on. append adds to the selection instead of replacing it. A name that can't be selected is an error. Needs: an open document. Changes: the selection only. Returns: data with selected_name and selection_count.

select_face_edgesA

Select every edge of one face of the active part, ready for add_fillet or add_chamfer with no edge names.

Pick the face with one of point (a point on it, mm), side (top, bottom, front, back, right, left or +X..-Z; the furthest flat face that way) or plane (the face lying on that plane). edge_type narrows to linear or circular edges (hole rims). Needs: an open part. Changes: the selection only. Returns: data with face, edges, selected_edges and selection_count.

rebuild_modelA

Rebuild the active model and report each feature that fails, with the reason and a fix.

Use it after set_dimension or other edits to confirm the model is sound. Failing features make the call an error whose data.errors names each one, its SolidWorks error, what it depends on and a hint; warnings alone still succeed. Needs: an open part or assembly. Changes: rebuilds the model. Returns: data with rebuilt, errors, error_count, warning_count and summary.

undoA

Undo the last operations in the active model (Edit > Undo).

Use it to step back after a feature went wrong. SolidWorks accepts an undo with nothing to undo, so the reply says whether the feature tree changed. Needs: an open document. Changes: reverts the last count operations. Returns: data with requested_steps, features_before, features_after and tree_changed.

create_reference_planeA

Add a reference plane offset from, at an angle to, or on a plane or flat face.

Use it to sketch somewhere other than the three default planes: pass the new plane's name to create_sketch. Offset: reference and a non-zero offset (mm). Angle: reference, angle (degrees) and axis, an axis lying in the reference (make one with create_axis). Face: face_point, a point on a flat face (sloped or not), with an offset or 0 for a plane on the face. Needs: an open part. Changes: adds a plane feature. Returns: plane with name and the inputs used.

create_axisA

Add a reference axis along the model's x, y or z direction, through the origin.

Use it before pattern_circular, which rotates features about an axis. It is built where two default planes meet. Needs: an open part. Changes: adds an axis feature. Returns: axis with name (e.g. "Axis1", for create_reference_plane's axis), reference, planes and the feature counts.

create_reference_pointA

Add a reference point on an edge (at a distance or percentage along it) or at the centre of a face.

Use it to mark a position for a later feature or measurement. Pick the edge or face with a point on it in mm. Needs: an open part with that edge or face. Changes: adds a point feature. Returns: point with mode, at_mm, distance_mm or percent, and the feature counts.

mirror_featureA

Mirror solid bodies or features of the active part about a plane.

Use it for symmetric parts: model one half, then mirror. Body mirroring (the default) is what works for lofts and sweeps; to mirror a cut, name the cut and set mirror_bodies off. It fails when the volume doesn't change, which means nothing was mirrored. Needs: an open part with the named bodies or features. Changes: adds a Mirror feature. Returns: mirror with name, mirrored, mirror_plane, merge, mirror_bodies, and volume_before, volume_after and volume_change (mm³, negative for a cut).

pattern_circularA

Repeat features of the active part around an axis, e.g. a ring of bosses or ribs.

Create the axis first with create_axis. Bosses and cuts both work (a ring of holes is a patterned cut). It fails when the volume doesn't change, which means no instance landed on the part. Needs: an open part with the named features and axis. Changes: adds a circular pattern feature. Returns: pattern with name, patterned, axis, count, angle, equal_spacing, and volume_before, volume_after and volume_change (mm³, negative for cuts).

pattern_linearA

Repeat features of the active part in a row or a grid, e.g. a row of holes.

Give the direction as a point on a straight edge (mm) or an axis name; add direction2 for a grid. Bosses and cuts both work. SolidWorks picks which way an edge points; if instances land off the part, set reverse or reverse2. It fails when the volume doesn't change, which means no instance landed on the part. Needs: an open part with the named features. Changes: adds a linear pattern feature. Returns: pattern with name, patterned, count, spacing_mm, and volume_before, volume_after and volume_change (mm³).

create_shellA

Hollow the active part to a wall thickness, opening the faces picked.

Use it for boxes, housings and cups: pick the face to open with a point on it (mm). It fails when the volume doesn't change. Needs: an open part with a solid body. Changes: adds a Shell feature. Returns: shell with name, thickness_mm, faces_removed, and volume_before, volume_after and volume_change (mm³).

add_draftA

Draft faces of the active part by an angle, e.g. for a moulded part.

Pick each face to draft and the neutral face it pivots on (usually the parting or bottom face) with a point on each (mm). It fails when the volume doesn't change. Needs: an open part. Changes: adds a Draft feature. Returns: draft with name, angle, faces_drafted, and volume_before, volume_after and volume_change (mm³).

create_ribA

Add a rib from a sketched line, stiffening a wall or the inside of a shell.

Sketch an open line where the rib goes (it can stop short of the walls; the rib extends to meet them), close the sketch, then call this with its name. It fails when the volume doesn't change. Needs: an open part and the rib sketch. Changes: adds a Rib feature. Returns: rib with name, sketch, thickness_mm, and volume_before, volume_after and volume_change (mm³).

create_base_flangeA

Start a sheet-metal part: a base flange from a sketch, with its thickness, bend radius and K-factor.

A closed sketch (a rectangle) makes a flat plate; an open one (a line or an L) makes a bent profile extruded by depth. Use it as a sheet-metal part's first feature, then add_edge_flange, create_sketched_bend and set_flat_pattern; export the blank with export_flat_pattern. The values are read back from the feature. Needs: an open part with the profile sketch closed. Changes: adds a Base-Flange feature and makes the part sheet metal. Returns: flange with name, thickness_mm, bend_radius_mm, k_factor and volume_after (mm³).

add_edge_flangeA

Add a flange to one edge of a sheet-metal part, at a length and angle.

Pick the edge with a point on it in mm (edge_point), e.g. on the top face's long edge. length is measured from that edge, so on a 2 mm sheet a 20 mm flange stands 22 mm above the bottom face. It fails when the volume doesn't change. Needs: a sheet-metal part (create_base_flange first). Changes: adds an Edge-Flange feature. Returns: flange with name, edge_length_mm (to check the pick) and volume_change (mm³).

create_sketched_bendA

Bend a sheet-metal part along a line sketched on one of its faces.

Sketch a line across a face of the sheet (create_sketch with face_point, then add_line), close the sketch, then call this. SolidWorks chooses which side of the line stays put; the reply's bounding_box_mm shows which side moved, and reverse bends the other way. Needs: a sheet-metal part and the bend-line sketch. Changes: adds a Sketched Bend feature. Returns: bend with name and bounding_box_mm.

set_flat_patternA

Flatten a sheet-metal part to its blank, or fold it back, and measure it.

Flattened, bounding_box_mm is the blank to cut: check it against the part's size and the bend allowance before export_flat_pattern writes the DXF. Fold it back before adding more features. Needs: a sheet-metal part. Changes: unsuppresses (flat) or suppresses (folded) the Flat-Pattern feature. Returns: flat, feature and bounding_box_mm.

list_hole_sizesA

List the Hole Wizard's hole types and sizes for a standard, or one size's dimensions.

Read from SolidWorks' installed Hole Wizard library, so the sizes are the ones create_hole accepts; it works without SolidWorks running. Give hole_type for every hole type of that kind with its sizes, add fastener for one type only, or size for its dimensions (counterbore diameter and depth, head diameter, pitch: mm, inches for ansi_inch). Needs: SolidWorks' Toolbox library on this machine (or SOLIDWORKS_MCP_HOLE_LIBRARY). Changes: nothing. Returns: library with standard, hole_type, units and either hole_types (each name and sizes) or fastener and dimensions.

create_holeA

Add a standard Hole Wizard hole (simple, counterbored, countersunk or tapped) at a point on a flat face.

Use it instead of sketching a circle and cutting: the hole is sized from the standard, so it fits the fastener and a drawing shows its callout. Several holes on one face: give the rest as positions (one feature, a hole at each point); a regular grid can also use pattern_linear. Sizes come from the Hole Wizard library (list_hole_sizes): an unknown size is refused, with the nearest ones, before anything is made. A simple hole can't be through all in SolidWorks, so it is made blind through the part (end_condition_used, with a warning). It fails when the volume doesn't change. Needs: an open part with a flat face at face_point. Changes: adds a hole feature. Returns: hole with name, hole_count, hole_type, standard, fastener (the hole type used), size, end_condition, end_condition_used, and volume_before, volume_after and volume_change (mm³).

add_cosmetic_threadA

Add a cosmetic thread to a hole or shaft, so drawings show the thread callout.

Pick the circular edge where the thread starts with a point on it (mm). The thread is drawn, not modelled, so the volume must not change; it fails if it does. Needs: an open part with a round edge at edge_point. Changes: adds a Cosmetic Thread feature. Returns: thread with name, size, diameter_mm, end_type and depth_mm.

list_equationsA

List the active part's or assembly's equations and global variables, with their values.

Use it before set_equation or delete_equation, to see which values drive which dimensions. Needs: an open part or assembly. Read-only. Returns: equations, each with index, name, expression, kind (global_variable, dimension or other) and value (solved, in the document's units; null when SolidWorks has none), and count.

set_equationA

Add or change an equation or global variable, so one value drives others (a parametric part).

E.g. Width = 60mm, then D1@Sketch1 = "Width" / 2: changing Width later resizes the sketch. A name with @ is a dimension of the active document (list_model_dimensions); any other is a global variable. An existing equation for name is changed, else one is added; the model is solved and rebuilt. Applies in all configurations unless configurations says otherwise. An expression SolidWorks can't use fails as equation_refused, changing nothing. Needs: an open part or assembly. Changes: the equation and what it drives. Returns: equation with name, expression, kind, value (document units), action (added or changed) and configurations.

delete_equationA

Delete an equation or global variable of the active part or assembly, by name.

A dimension the equation drove keeps its last value; an equation that used a deleted global variable stops solving, so check list_equations afterwards. Needs: an open part or assembly with that equation. Changes: removes the equation. Returns: deleted and the equations left (names).

create_exploded_viewA

Explode the active assembly, automatically or step by step, and show it.

Use it to show how an assembly goes together, and before an exploded drawing view (create_drawing_view with exploded, drawing toolset). With no steps SolidWorks explodes it automatically; each step moves named components a distance along x, y or z. Needs: an open assembly. Changes: adds an exploded view to the active configuration and shows it. Returns: exploded_view with its view name, steps, and the bounding box size_before_mm and size_after_mm. A component it doesn't hold fails as not_found.

set_exploded_viewA

Show the active assembly exploded, or collapse it.

Use it to switch between the exploded view create_exploded_view made and the assembled one. Needs: an open assembly with an exploded view. Changes: what the view shows; nothing in the model. Returns: exploded_view with the view, exploded as read back and the bounding box size_mm. No exploded view fails as not_found.

pattern_componentsA

Repeat assembly components in a row along an axis, or around one.

Use it for a row of bolts or pins, or parts around a hub. axis names a reference axis (create_axis in the assembly); count includes the seeds. Linear takes spacing (mm); circular takes angle (degrees, 360 spaces them equally). The row runs along the axis's own direction, which SolidWorks picks (an x axis from create_axis runs toward -x), so check the result with verify_model's bounding box. Needs: an open assembly with the seeds and the axis. Changes: adds a component pattern feature. Returns: pattern with the feature name, the component counts before and after and the added instances.

mirror_componentsA

Mirror assembly components about a plane, as instances of the same parts.

Use it for a part that appears on both sides, such as a pair of feet or brackets. Needs: an open assembly with the components and the plane. Changes: adds mirrored instances (no new part files). Returns: mirror with the plane and the added instances' names. A plane it doesn't have fails as not_found.

replace_componentA

Swap an assembly component for another part or assembly file.

Use it to try another version of a part (a longer pin, a different motor) without re-inserting and re-mating it. all_instances replaces every instance of the same file, patterned copies included. Mates are kept where they still fit. Needs: an open assembly and the new file. Changes: the component's file. Returns: replace with the replaced instances and their files read back, and the components before and after. A file that doesn't exist fails as invalid_input.

create_sketchA

Open a new sketch on a plane or a flat face of the active part, ready for lines, circles and other sketch entities.

Use it first in every feature: sketch, draw, exit_sketch, then create_extrusion or create_cut_extrude. Planes: Front, Top, Right (or XY, XZ, YZ), or a plane made by create_reference_plane. Or give face_point, a point in mm on a flat face of the body: the sketch opens on that face and moves with it when the model changes. Coordinates in the sketch are mm from the origin. Needs: an open part. Changes: adds a sketch and opens it for editing; give sketch_name and exit_sketch names it that when it closes it (SolidWorks won't rename an open sketch). Returns: sketch with name (the name in the feature tree now) and plane (or face_point), plus name_on_exit when you gave sketch_name. A face_point not on a flat face fails with invalid_input.

add_lineA

Draw a straight line between two points in the open sketch, in mm.

Use it for profiles made of straight edges; for a closed box, use add_rectangle, and for a revolve axis, add_centerline. Needs: an open sketch (create_sketch). Changes: adds a line (a construction line with construction). Returns: line with id, start, end and length. Its id is what add_sketch_constraint and add_sketch_dimension take.

add_circleA

Draw a circle in the open sketch from its centre and radius, in mm.

Use it for holes and round bosses. Needs: an open sketch (create_sketch). Changes: adds a circle (a construction circle with construction). Returns: circle with id, center, radius and diameter. Its id is what add_sketch_constraint and add_sketch_dimension take.

add_rectangleA

Draw a closed, axis-aligned rectangle in the open sketch from two opposite corners, in mm.

Use it for blocks, plates and rectangular cut-outs. Needs: an open sketch (create_sketch). Changes: adds four connected lines. Returns: rectangle with id, corner1, corner2, width, height and area. Its id is what add_sketch_constraint and add_sketch_dimension take.

exit_sketchA

Close the open sketch so a feature can use it.

Call it after drawing and before create_extrusion, create_revolve or create_cut_extrude; those use the sketch closed last. Needs: an open sketch. Changes: leaves sketch editing; the sketch stays in the feature tree, renamed to the sketch_name create_sketch was given. Returns: a message, plus, after a sketch_name, sketch with name (the name in the feature tree, which later tools take as sketch_name) and a warning when the name couldn't be given (another feature has it).

check_sketch_fully_definedA

Check whether a sketch is fully defined, under-defined or over-defined.

Use it after adding relations and dimensions, to see if the sketch still has free geometry. Needs: an open part with the sketch. Read-only. Returns: sketch with sketch_name, is_fully_defined (null when unknown), definition_state and where the answer came from (source).

add_arcA

Draw a circular arc in the open sketch: from its centre, through three points, or tangent.

Use it for rounded ends and curved edges of a profile. kind center (the default) takes the centre, start and end, counter-clockwise; three_point takes start, end and a point the arc passes through (through_x, through_y); tangent starts at the end of an existing entity (start) and leaves tangent to it. Needs: an open sketch (create_sketch). Changes: adds an arc. Returns: arc with id, kind, center, start_point and end_point. Its id is what add_sketch_constraint and add_sketch_dimension take.

add_splineA

Draw a smooth spline through a list of points in the open sketch, in mm.

Use it for free-form curves such as an aerofoil or a handle profile. Needs: an open sketch (create_sketch). Changes: adds a spline. Returns: spline with id, control_points and point_count.

add_centerlineA

Draw a centreline (construction line) in the open sketch, in mm.

Use it as the axis for create_revolve, or as the line for sketch_mirror and symmetric relations. It is never part of the profile. Needs: an open sketch (create_sketch). Changes: adds a centreline. Returns: centerline with id, start_point and end_point.

add_polygonA

Draw a regular polygon (e.g. a hexagon) in the open sketch from its centre, radius and number of sides.

Use it for nuts, hex bosses and pockets. Needs: an open sketch (create_sketch). Changes: adds the polygon's sides. Returns: polygon with id, center, radius, sides and angle. A diameter dimension (add_sketch_dimension) on its id sizes it by the circle drawn inside it.

add_ellipseA

Draw an ellipse in the open sketch from its centre and axis lengths, in mm.

Use it for oval holes and bosses. Needs: an open sketch (create_sketch). Changes: adds an ellipse. Returns: ellipse with id, center, major_axis, minor_axis and angle.

add_sketch_textA

Write text in the open sketch, at a point or centred on one, to deboss or emboss it.

Use it for lettering, then cut (create_cut_extrude) or extrude the sketch. center_at (a model point in mm) puts the text's middle there; otherwise it starts at x, y. $PRP:"name" in the text shows a custom property; one holding a dimension's name ("D1@Sketch3", set with set_custom_property) makes the text follow that dimension. To read from a face's own side, such as an underside, open the sketch on that face (create_sketch face_point). Needs: an open sketch (create_sketch). Changes: adds text. Returns: the text's id, the text as SolidWorks shows it (links resolved) and its height.

set_sketch_textA

Rewrite the text in a sketch and rebuild, so debossed lettering shows it.

Use it after a change the text should follow: SolidWorks doesn't redraw sketch text on rebuild, not even a $PRP: link to a dimension an equation changed. Give the same $PRP:"name" text to re-read the link, or new text. The sketch is opened, its text rewritten, closed, and the model rebuilt, so a cut made from it changes too. Needs: a part with that sketch, holding text from add_sketch_text. Changes: the sketch's text. Returns: the sketch, each text before and after (links resolved).

add_sketch_constraintA

Add a geometric relation between sketch entities: horizontal, vertical, parallel, perpendicular, tangent, coincident, concentric, equal, symmetric, collinear or fix.

Use it to hold design intent, then check with check_sketch_fully_defined. Entities are the ids the add_* tools returned. Needs: an open sketch (create_sketch). Changes: adds the relation. Returns: constraint with id, type and the entities.

add_sketch_dimensionA

Add a driving dimension to sketch entities: linear, angular, radial, diameter or an ellipse axis.

Use it to fix a size so the sketch is fully defined and can be changed later with set_dimension. Entities are the ids the add_* tools returned; two connected lines for angular, a circle or arc for radial or diameter, an ellipse for major_axis or minor_axis (value is the whole axis; the dimension runs from the centre, so it shows half). No dialog opens. Needs: an open sketch (create_sketch). Changes: adds the dimension and resizes the geometry to value. Returns: dimension with id, type, value and the entities.

sketch_linear_patternA

Repeat sketch entities in a straight line at a fixed spacing.

Use it for rows of holes or slots before one cut. Needs: an open sketch (create_sketch). Changes: adds copies of the entities. Returns: pattern with id, entities, count, spacing and direction.

sketch_circular_patternA

Repeat sketch entities around the sketch origin, e.g. a bolt circle.

The centre is always the sketch origin, so draw the first entity at the radius you want from it. Then cut once with create_cut_extrude. Needs: an open sketch (create_sketch). Changes: adds copies of the entities. Returns: pattern with id, entities, count and angle.

sketch_mirrorA

Mirror sketch entities about a centreline in the open sketch.

Use it for symmetric profiles: draw one half, add a centreline with add_centerline, then mirror. Needs: an open sketch (create_sketch). Changes: adds mirrored copies. Returns: mirror with id, entities and mirror_line.

sketch_offsetA

Offset sketch entities by a distance in mm, outward or inward, e.g. for a wall or a clearance.

Needs: an open sketch (create_sketch). Changes: adds the offset entities. Returns: offset with id, entities, distance and direction (outward or inward).

sketch_convert_entitiesA

Copy model edges, or a face's whole outline, into the open sketch (Convert Entities).

Use it to sketch on an existing edge exactly, e.g. to cut a pocket that follows a face, instead of re-drawing it at guessed coordinates. Pick edges or a face with a point on each (mm). Needs: an open sketch (create_sketch) and a part with those edges. Changes: adds the copied entities, tied to the edges. Returns: converted with entities (ids for the other sketch tools), count and construction.

add_sketch_filletA

Round corners of the open sketch to a radius, picking each corner by its point.

Use it for rounded corners of a 2D profile, such as a cut's outline; round a solid's edges with add_fillet instead, last in the feature tree. Give each corner's [x, y] in sketch mm, where two entities meet (for a rectangle, its corners). Needs: an open sketch (create_sketch) with entities meeting at each corner. Changes: each corner becomes an arc and the entities either side are trimmed back to it. Returns: fillet with one id per corner, the corners and the radius. A corner with no sketch point fails as invalid_input and nothing changes.

add_sketch_chamferA

Bevel corners of the open sketch, picking each corner by its point.

Use it for bevelled corners of a 2D profile; bevel a solid's edges with add_chamfer instead, last in the feature tree. distance alone cuts the same distance along both sides; add distance2 for a different second side, or angle (degrees) for a distance and an angle. Needs: an open sketch with entities meeting at each corner ([x, y] in sketch mm). Changes: each corner becomes a line and the entities either side are trimmed back to it. Returns: chamfer with one id per corner, the corners and the sizes. A corner with no sketch point fails as invalid_input and nothing changes.

add_slotA

Draw a slot in the open sketch: straight between two centres, or along an arc.

Use it for adjustment slots and keyways, then cut it (create_cut_extrude). A straight slot takes its two end centres, start and end. An arc slot (kind arc) takes the center of the arc it follows and start and end on that arc, counter-clockwise. Needs: an open sketch (create_sketch). Changes: adds one closed slot. Returns: slot with its id, the points, the width and its area (mm²).

sketch_trimA

Trim away the piece of a sketch entity at a point, back to where it meets others.

Use it to clean up overlapping shapes into one profile, such as the arc inside a keyhole. point ([x, y] sketch mm) is on the piece to remove; an entity that meets nothing is removed whole. Needs: an open sketch with an entity at the point. Changes: removes that piece. Returns: trim with the point and the sketch's segments_before and segments_after. A trimmed entity's id may no longer name a whole segment. Nothing at the point fails as invalid_input.

sketch_extendA

Lengthen a sketch entity from its end nearest a point until it meets the next entity.

Use it to close a gap, such as lines that stop short of a circle. point ([x, y] sketch mm) is on the entity, near the end to lengthen. Needs: an open sketch with an entity at the point and another in its way. Changes: that end moves to the next entity. Returns: extend with the point and the segment counts. Nothing at the point, or nothing to reach, fails as invalid_input.

set_construction_geometryA

Make sketch entities construction geometry, or normal again, by id.

Use it for reference lines and circles a feature should ignore, such as a line to dimension from or a bolt circle. Needs: an open sketch and ids the sketch tools returned. Changes: each entity's construction setting (setting it to what it already is changes nothing). Returns: construction_geometry with each id's state. An unknown id fails as invalid_input and nothing changes.

sketch_tutorial_simple_holeA

Deprecated: no replacement.

Demonstrate the sketch steps: draw a 5 mm circle at the origin on the Top plane and close the sketch.

It is a fixed example; for a real hole, use create_sketch, add_circle, exit_sketch and create_cut_extrude. Needs: an open part. Changes: adds a sketch with one circle. Returns: steps_completed, next_step (cut the hole with create_cut_extrude) and suggested_cut, that call's input.

create_drawing_viewA

Place one named view of a part or assembly on the active drawing sheet.

Use it to add views one at a time; for the three standard views in one call, use create_technical_drawing, and for a whole drawing from a model, use generate_drawing_package. Needs: an open, active drawing and the model file on disk. Changes: adds a view to the sheet. Returns: data with the view's name, orientation, position, scale and the view counts before and after.

add_dimensionA

Add one dimension to a drawing view, between edges picked by points on the sheet.

Give points in sheet mm on a view's edges or vertices (read view outlines with check_drawing). Two parallel edges give their distance; one edge its length; a circle's edge its radius or diameter; two lines their angle. For the model's own dimensions use insert_model_dimensions instead. Needs: an open, active drawing. Changes: adds a reference dimension. Returns: dimension with name, value and units (mm, deg for angular).

add_noteA

Place a text note on the active drawing sheet at a position in millimetres.

Use it for general notes such as material or finish. For a title block, use generate_drawing_package, which fills one. Needs: an open, active drawing. Changes: adds a note to the sheet. Returns: data with text, position, positioned (whether the position was applied) and font_size_points.

create_section_viewA

Cut a section view along a line across a drawing view, and place it on the sheet.

Give the line's ends in sheet mm so it crosses the view (e.g. through a hole's centre), and where the new view goes. A line that misses the view, or a position off the sheet, is refused before anything changes. Needs: an open, active drawing with that view. Changes: adds a section view and its section line. Returns: view with name, label, parent and outline_mm.

create_detail_viewA

Magnify a circular area of a drawing view as a detail view, at a scale.

Give the circle's centre (sheet mm, inside the view) and radius, where the new view goes, and its scale. A centre outside the view or a position off the sheet is refused before anything changes. Needs: an open, active drawing with that view. Changes: adds a detail view and its circle. Returns: view with name, label, scale, parent and outline_mm.

update_sheet_formatA

Change the active drawing sheet's format and paper size, keeping every view.

Give a format name SolidWorks has (e.g. "a2 - iso") or a .slddrt path; the paper size comes from the name unless given. The views are checked to be the same afterwards, and the title block keeps its values (they are properties). Needs: an open, active drawing. Changes: the sheet's format and size. Returns: sheet with sheet_format (the path), paper_size, sheet_mm and views.

auto_dimension_viewA

Dimension one drawing view with SolidWorks' auto-dimension (baseline or chain).

It adds reference dimensions measured from the view's edges; prefer insert_model_dimensions, which shows the model's own (driving) dimensions, and use this for a view that has none to bring in. Dimensions may overlap: run arrange_dimensions after. It fails when nothing is added. Needs: an open, active drawing with that view. Changes: adds dimensions. Returns: data with added and the counts before and after.

check_drawingA

Check the active drawing is complete before exporting it: views, dimensions, title block, BOM.

Read-only. Findings: view_off_sheet (error), view_not_dimensioned (warning; isometric and detail views excepted), title_block_field_empty (warning: title, drawn by, revision), dangling_annotation (error) and bom_missing (warning, an assembly with no BOM). Each names the tool that fixes it. It checks completeness, not a drafting standard. Needs: an open, active drawing. Returns: passed (no errors), errors, warnings, findings (each rule, severity, message, maybe view), views and report (the facts read).

create_technical_drawingA

Place a model's three standard views (front, top and side) on the active drawing sheet in one call.

Use it to start a drawing's views quickly; for one view, use create_drawing_view, and to create and save a complete drawing from a model file, use generate_drawing_package. Views are laid out in projection (third-angle by default). Needs: an open, active drawing and the model file on disk. Changes: adds three views to the sheet. Returns: data with views (the names added), model_path, projection and the view counts.

add_drawing_viewA

Deprecated: use create_drawing_view.

Place one named view of a part or assembly on the active drawing sheet; the same as create_drawing_view.

Prefer create_drawing_view; this tool reaches the same code and is kept for existing callers. It only adds views: an operation other than "add" is refused. Needs: an open, active drawing and the model file on disk. Changes: adds a view to the sheet. Returns: data with the view's name, orientation, position, scale and the view counts.

update_title_blockA

Change the active drawing's title-block fields: title, drawing number, drawn by, date, revision, company.

Each field is written to the property the sheet format shows (the same mapping generate_drawing_package uses): the title is the drawn model's Description, the others the drawing's own properties. Fields not given keep their values. Needs: an open, active drawing of a model. Changes: those properties. Returns: fields, each with the property written, on (drawing or model) and value.

list_drawing_viewsA

List the views on the active drawing, by name.

Use it before auto_center_marks, insert_model_dimensions or any tool that takes a view name. Needs: an open, active drawing. Read-only. Returns: views (names, sheet formats left out) and count.

auto_center_marksA

Insert centre marks on the holes, slots and (optionally) fillets of one drawing view.

Use it after placing views, before dimensioning holes. Adding none is still a success: the view may have no unmarked circular edges. Needs: an open drawing with the named view (see list_drawing_views). Changes: adds centre-mark annotations to the view. Returns: data with center_marks_added and the counts before and after.

add_balloonsA

Number the parts in a drawing view with balloons, one per part.

Use it on an assembly drawing, with a BOM (insert_bom_table): the balloons carry the BOM's item numbers. Works best on an exploded view (create_drawing_view with exploded). Needs: an open drawing with a view of an assembly. Changes: adds balloons around the view. Returns: balloons with the view, layout, count and the items shown. A view that isn't there fails as not_found.

compare_drawing_versionsA

Compare two drawing files on disk: whether they are byte-identical, and how their sizes differ.

Use it to tell whether a drawing changed between two saved versions. It does not open SolidWorks, so it can't say which views, dimensions or notes differ. Identical files mean nothing changed, but different files may not: SolidWorks writes a different file each time it saves, even with no change. Needs: both files on disk. Read-only. Returns: comparison with file_1 and file_2 (size, modified time, SHA-256), identical and size_delta_bytes.

insert_model_dimensionsA

Bring the model's dimensions into the active drawing's views, each dimension shown once.

Imports the model's "marked for drawing" dimensions view by view; a repeat in a later view is deleted. Pictorial views (isometric, dimetric, trimetric) are skipped unless named. Falls back to SolidWorks AutoDimension only when nothing could be imported. SolidWorks places them inside the views, so run arrange_dimensions next. Needs: an open, active drawing with views. Changes: adds dimensions to the views. Returns: data with per-view views (before/after counts, duplicates_removed), dimensions_added, unique_dimensions, skipped_pictorial_views and the method used. An unknown view is not_found.

arrange_dimensionsA

Move drawing dimensions out of their views into tidy rows so nothing overlaps, then check the sheet.

Rows start 8 mm outside each view, 7 mm apart, shortest span nearest the view. A dimension with no room stays put and is listed in unplaced. The check reads back every text box and line: no text on text, no line through text or across a view, nothing off the sheet. Use it after insert_model_dimensions. Needs: an open, active drawing. Changes: moves dimensions on the sheet. Returns: data with dimensions, moved, overlaps_before, overlaps_after and unplaced. If any overlap remains the call is an error whose data lists remaining_overlaps; try a smaller sheet scale (set_sheet_scale).

insert_bom_tableA

Insert a bill-of-materials table for an assembly view on the active drawing.

Use it on an assembly drawing after placing a view of the assembly (see list_drawing_views for view names). Needs: an open, active drawing with a view of an assembly. Changes: adds a BOM table to the sheet. Returns: data with view, bom_type, template and row_count. An unknown view is not_found and the message lists the views.

add_gtolA

Add a GD&T feature control frame to the active drawing, e.g. position Ø0.2 (M) to A|B|C.

Attach it to a drawing dimension (dimension_view + dimension_name; the frame sits under the dimension's text, the usual place for a hole's position tolerance), or place it at x_mm/y_mm with an optional leader to the edge at attach_x_mm/attach_y_mm. Add the datums it refers to with add_datum_tag. Needs: an open, active drawing. Changes: adds the frame. Returns: data, the frame as read back from SolidWorks. No edge at the attach point is not_found.

add_datum_tagA

Add a datum feature symbol (A, B, C, ...) on an edge of the active drawing.

Use it to mark the datums a feature control frame from add_gtol refers to. Needs: an open, active drawing with an edge at the attach point. Changes: adds the datum tag. Returns: data with the label as read back. No edge at the point is not_found.

set_sheet_scaleA

Set the active drawing sheet's scale, e.g. 1:2; views that use the sheet scale follow it.

Use it when views are too large for the sheet, or when arrange_dimensions reports overlaps it can't clear. Needs: an open, active drawing. Changes: the sheet scale. Returns: data with the sheet name and the new scale.

generate_drawing_packageA

Create a complete A3 drawing of a part or assembly in one call, and save it with a PDF.

It opens a new drawing with an A3 ISO frame and fills the title block (title, number, material, weight, drawn by, date, revision). It places front, plan, side and isometric views at one standard scale, shows the model dimensions once in tidy rows, and adds view captions and a NOTES block. Then it checks nothing overlaps. Use it instead of the step-by-step drawing tools when you want the whole drawing. Needs: the model file on disk. Changes: saves <drawing_number>.SLDDRW and a PDF, replacing files of those names, and by default writes Description, Material and Weight into the model and saves it (turn off with write_model_properties). Returns: data with scale, views, dimensions, overlap_check, title_block, drawing_path, pdf_path and steps. A remaining overlap makes the call an error carrying that data; for long title-block text pass title_block_text_height_mm (e.g. 3).

list_model_dimensionsA

List every dimension in the active part or assembly with its full name and value.

Use it to find a dimension in an existing model before changing it: each full_name (e.g. "D1@Sketch1") is the name get_dimension and set_dimension take. Each dimension is listed once, under the feature its full name names after the @ (D1@Plane1 under Plane1, never also under a cut sketched on that plane). Needs: an open part or assembly. Read-only. Returns: data, one entry per dimension with full_name, feature, value (document units), system_value (metres or radians) and read_only.

measure_entitiesA

Measure faces, edges or vertices of the active model with SolidWorks' Measure tool.

One face gives area and perimeter; one edge its length, and radius and diameter for an arc; two entities give the distance and angle between them. Use it to check a feature's size or position; for the whole model, use verify_model. Needs: an open part or assembly. Read-only. It clears the selection afterwards. Returns: data with selected and the values in metres, square metres and radians (distance_m, angle_rad, length_m, radius_m, diameter_m, area_m2, perimeter_m; for two entities is_parallel).

get_materialA

Report the active part's material with its strength and stiffness, or any library material's.

Use it to size a part (the elastic modulus and yield strength) or to compare materials before set_material, and before get_mass_properties (without a material SolidWorks uses a default density). Give material to read a library material without assigning it: no document is needed and none changes. Needs: an open, active part unless material is given (any other document is wrong_document_type). Read-only. Returns: data with material (null when none is assigned), database, density_kg_m3, source (part or library) and properties: elastic_modulus, poissons_ratio, shear_modulus, tensile_strength, yield_strength, compressive_strength, density, thermal_expansion, thermal_conductivity, specific_heat, each with value in SI units (Pa; divide by 1e6 for MPa), unit and label. A property the library doesn't hold for that material is left out.

set_materialA

Assign a library material to the active part, e.g. "AISI 1020" or "6061-T6 (SS)".

The material sets the mass and what a title block's Material field shows. The name must match the library exactly; find it with list_available_materials. The material is read back, so success means it applied. Needs: an open, active part. Changes: the part's material. Returns: data with material, database and configuration.

list_available_materialsA

List the materials in the installed SolidWorks material libraries.

Use it to find the exact name set_material needs; filter with search (e.g. "steel" or "6061"). It reads every .sldmat library SolidWorks is set to use. Needs: SolidWorks installed. Read-only. Returns: data, each material's name, classification and database; the message gives the total and the folders read, so an empty search can be told from a missing library.

get_custom_propertiesA

Read the active document's custom properties, such as PartNo, Description or Revision.

File-level properties (the default) are what drawing title blocks and BOMs usually read; give configuration for that configuration's own. Needs: an open, active document. Read-only. Returns: data with properties, each name mapped to its value and resolved value (a $PRP link evaluated).

set_custom_propertyA

Create or overwrite one text custom property on the active document, e.g. PartNo or DrawnBy.

Use it to fill what a title block or BOM reads. The value is read back, so success means it was stored. Needs: an open, active document. Changes: writes the property, replacing one of the same name (save the file to keep it). Returns: data with name, value, resolved and configuration.

export_flat_patternA

Export the active sheet-metal part's flat pattern to DXF or DWG, for laser or waterjet cutting.

It writes the flat outline only, without bend lines or sketches. A part with no sheet-metal body is not_found and nothing is written. Needs: an open, active sheet-metal part. Changes: writes the file, replacing one already there. Returns: data with file_path and size_bytes.

get_mass_propertiesA

Measure the active part or assembly's mass properties: volume, surface area, mass, centre of mass and moments of inertia.

Use it to check weight or balance. To compare a model with the values you expect, use verify_model. Mass depends on the assigned material (set_material). Needs: an open part or assembly. Read-only. It rebuilds first. Returns: mass_properties with volume (mm³), surface_area (mm²), mass (kg), center_of_mass (mm), moments_of_inertia (kg·mm², about the centre of mass) and principal_axes.

calculate_mass_propertiesA

Deprecated: use get_mass_properties.

Measure the active part or assembly's mass properties (the old name of get_mass_properties).

It returns exactly what get_mass_properties returns; use that instead. Needs: an open part or assembly. Read-only. It rebuilds first. Returns: mass_properties with volume (mm³), surface_area (mm²), mass (kg), center_of_mass (mm), moments_of_inertia (kg·mm²) and principal_axes.

check_interferenceA

Find where the components of the active assembly overlap (Tools > Interference Detection).

Use it after inserting and mating components. A count of 0 is a real measurement. To fail a build on interference, use verify_model with no_interference. Needs: an open, active assembly. Read-only. Returns: data with interference_found, interference_count, interferences (component pairs and overlap volume in mm³) and scope.

verify_modelA

Check the active part or assembly against what you meant to build, one pass/fail check per expected value.

Use it as the last step of a build: a modelling tool's success doesn't prove the geometry is right. Give only the values you know. Units: mm, mm³, kg; bounding_box_mm is [x, y, z] in model axes. Widen relative_tolerance when your sums ignore fillets. Needs: an open part or assembly. Read-only. Returns: verdict (pass, fail, inconclusive or report_only), checks (each expected, actual, tolerance, passed; null when unmeasured) and measured. A mismatch is still status: success.

export_stepA

Export the active document to STEP, like File > Save As with the STEP type.

Use it to hand a model to another CAD system; it is the most widely read exchange format. SolidWorks picks the format from the file's extension, so end file_path in .step or .stp. Needs: an open, active part or assembly. Changes: writes the file, creating its folder and replacing a file already there; the open document is unchanged. Returns: export with file_path and format.

export_igesA

Export the active document to IGES, like File > Save As with the IGES type.

Use it only when the receiver can't read STEP; prefer export_step. SolidWorks picks the format from the file's extension, so end file_path in .igs or .iges. Needs: an open, active part or assembly. Changes: writes the file, creating its folder and replacing a file already there; the open document is unchanged. Returns: export with file_path and format.

export_stlA

Export the active document to STL, like File > Save As with the STL type.

Use it for 3D printing. An assembly is exported whole, with lightweight components resolved first. SolidWorks picks the format from the file's extension, so end file_path in .stl. Needs: an open, active part or assembly. Changes: writes the file, creating its folder and replacing a file already there; the open document is unchanged. Returns: export with file_path and format, plus warning when SolidWorks wrote the file without its STL options (bodies not merged into one file).

export_pdfA

Export the active document to PDF, like File > Save As with the PDF type.

Use it to share a drawing; generate_drawing_package (drawing toolset) already saves a PDF with the drawing it creates. SolidWorks picks the format from the file's extension, so end file_path in .pdf. Needs: an open, active drawing (a part or assembly gives a PDF of the view). Changes: writes the file, creating its folder and replacing a file already there; the open document is unchanged. Returns: export with file_path and format.

export_dwgA

Export the active document to DWG, like File > Save As with the DWG type.

Use it to hand a drawing to AutoCAD users. SolidWorks picks the format from the file's extension, so end file_path in .dwg. Needs: an open, active drawing. Changes: writes the file, creating its folder and replacing a file already there; the open document is unchanged. Returns: export with file_path and format.

export_imageA

Save a picture of the active model in a standard view, as PNG or JPG, at a chosen size.

Use it to show a result, or to check a model's shape after a change. The view is set first (front, back, left, right, top, bottom, isometric, dimetric, trimetric, or current to keep the user's view). Needs: an open, active document. Changes: writes the image file, and turns the model to the view asked for. Returns: data with file_path, format, dimensions (the size written), requested_dimensions and view.

generate_vba_codeA

Write a VBA macro skeleton for an operation you describe: the SolidWorks connection, a check of the active document's type and optional error handling, with the operation itself left as a TODO.

Use it as a starting point for a custom macro. For a complete macro for a specific feature, use a generate_vba_* tool (extrusion, revolve, mates, drawing views, batch export). The macro reports through Debug.Print, never a dialog, so it runs without waiting on anyone: save it as a .swb file and run it with execute_macro (its Sub main() calls the Sub named sub_name; SolidWorks runs a .swb macro only through main). It stops, printing why, when the active document isn't target_document. Read-only. Nothing runs in SolidWorks. Returns: vba_code with code, sub_name, operation, target_document, lines_of_code and includes_error_handling.

save_fileA

Save the active part, assembly or drawing, to its own path or to a new path in its own format.

Use it after changes you want to keep. A new file_path is checked before SolidWorks is asked: its folder must exist and be writable, it must end in the document's extension (.sldprt, .sldasm, .slddrw), and a file already there is kept unless overwrite is on. To write another format, use save_as or an export_* tool; to copy an assembly with its parts, pack_and_go_assembly. Needs: an open, active document, already saved once unless you give a path. Changes: writes the file. Returns: file_path (when given) and data from the save.

save_asA

Save the active document under a new path, as a SolidWorks file or in an exchange format such as STEP or IGES.

For a SolidWorks format (solidworks, sldprt, sldasm, slddrw) it saves a copy like File > Save As; any other format_type is passed to the exporter. For one known format with its options, prefer export_step, export_stl and the other export_* tools. Needs: an open, active document. Changes: writes the file. A file already at file_path is kept and the call refused, unless overwrite is on. Returns: file_path and format.

save_as_templateA

Save the active part, assembly or drawing as a template, so new documents start from it.

Use it after setting up a document once (units with set_units, a material, custom properties) to start the next one the same way: pass the template to create_part, create_assembly or create_drawing as template. A part saves as .prtdot, an assembly as .asmdot, a drawing as .drwdot. Give file_path, or name to save in SolidWorks' first template folder so it also shows in File > New. Afterwards SolidWorks has the template open in place of the document, as File > Save As does (a saved document's file is left as last saved); the reply's warning says so. Save from a part with no features when only its settings should carry over. The path is checked before SolidWorks is asked: the extension must match, the folder must exist, and a file already there is kept unless overwrite is on. Needs: an open, active document. Changes: writes the template. Returns: data with file_path, document_type, in_template_folder, template_folders and document_became_template.

get_file_propertiesA

Deprecated: use get_model_info.

Report the active document's file details: name, path, size, dates, type, configuration and unsaved changes.

Use it to check what is open and whether it has unsaved changes before saving or closing. For the model itself (rebuild status included), use get_model_info; for custom properties, use get_custom_properties. Needs: an open, active document. Read-only. Returns: properties with file_name, file_path, file_size_bytes, created_date and modified_date (Unix timestamps; empty for a document never saved), document_type, configuration, is_dirty and feature_count.

get_model_infoA

Report the active document's title, path, type, configuration, unsaved changes, feature count, rebuild status and file details.

Use it first in a session, to see which document is active (it follows a switch made in the SolidWorks window). For every open document, use list_open_documents; for custom properties, get_custom_properties. Needs: an open document. Read-only. Returns: model_info with title, path, type, configuration, is_dirty, feature_count, rebuild_status (0 rebuilt, 1 needs a rebuild), and the file's size_bytes, created and modified (Unix timestamps; null for a document never saved).

list_featuresA

List the feature tree of the active part or assembly, in order.

Use it before editing a model, to find a feature's exact name for delete_feature, suppress_feature or rename_feature. For an assembly it also lists each component's features, down to max_assembly_depth levels. Needs: an open part or assembly. Read-only. Returns: features (each with name, type, suppressed and, in an assembly, component), count, and assembly_tree, the same list grouped by component.

get_selected_entitiesA

Describe the faces, edges and vertices selected in the SolidWorks window right now.

Use it when the user has clicked something and says "this face": it reads the selection instead of guessing from a screenshot. To select edges yourself, use select_face_edges. Needs: an open document. Read-only. Returns: entities (each with index and type; a face adds bounding_box_mm, center_mm, area_mm2 and normal when flat, an edge start_mm, end_mm and straight-line length_mm, a vertex point_mm) and count.

classify_feature_treeA

Classify the active model's kind (part, sheet metal, assembly, drawing and so on) from its feature tree, and suggest how to work on it.

Use it before rebuilding or editing an unfamiliar model, to pick a workflow. It reads the model unless you pass model_info and features you already have (from get_model_info and list_features). Needs: an open document, unless both are passed. Read-only. Returns: classification with family, recommended_workflow, confidence, needs_vba, evidence, warnings, next_actions and feature_count, plus the model_info and features used.

list_configurationsA

List the names of the active model's configurations, and which one is active.

Use it to see which configurations a part or assembly has before activate_configuration or delete_configuration. Needs: an open part or assembly. Read-only. Returns: configurations (names), count and active (null when it can't be read).

load_partA

Deprecated: use open_model.

Open a part (.sldprt) from disk and make it the active document.

Use it to start work on an existing part; for any document type, use open_model, and to switch to a document that is already open, use activate_document. A path that isn't a .sldprt is refused. Needs: the file on disk. Changes: opens the part (no file is written). Returns: model with name, type, path and configuration (the one SolidWorks opened, or null when it can't be read).

load_assemblyA

Deprecated: use open_model.

Open an assembly (.sldasm) from disk and make it the active document.

Use it to start work on an existing assembly; for any document type, use open_model, and to switch to a document that is already open, use activate_document. A path that isn't a .sldasm is refused. Needs: the file on disk. Changes: opens the assembly (no file is written). Returns: model with name, type, path and configuration (the one SolidWorks opened, or null when it can't be read).

save_partA

Deprecated: use save_file.

Save the active part in place, or as a new .sldprt with the target path checked first.

Before writing to a new path it checks the folder exists and is writable, changes the extension to .sldprt, and refuses an existing file unless overwrite is on. For other formats, use save_as or an export_* tool. Needs: an open, active part. Changes: writes the part file. Returns: file_path when saved to a new path.

save_assemblyA

Deprecated: use save_file.

Save the active assembly in place, or as a new .sldasm, optionally copying the parts it uses alongside.

Before writing to a new path it checks the folder exists and is writable, changes the extension to .sldasm, and refuses an existing file unless overwrite is on. With include_references, it instead copies the assembly file as last saved, and the files it references, into the new folder; unsaved changes are left out and references are not updated. To copy an assembly with its referenced parts, use pack_and_go_assembly. Needs: an open, active assembly, saved once for include_references. Changes: writes the assembly file (and copies). Returns: file_path, plus copied_files and missing_source_files when copying references.

pack_and_go_assemblyA

Copy an assembly and every file it uses into one folder that opens on its own.

Use it to hand over or archive an assembly. SolidWorks lists the files the assembly uses; each is copied under its own name, as saved on disk, so save first: a warning names any open file whose unsaved changes the copy doesn't have. The copy opens with its own parts, since SolidWorks looks in the assembly's folder first. It fails, copying nothing, when a file is missing, two files share a name, or target_dir holds the originals. It refuses a folder that already has files unless overwrite is on, and then replaces only the files it copies. It never closes or changes a document. It can add an isometric PNG preview. Needs: the .sldasm on disk. Changes: writes the copies into target_dir, creating it if needed. Returns: source_assembly, target_dir, copied_files, source_files, unsaved_changes and, with a preview, preview_image.

list_open_documentsA

List every document open in SolidWorks and say which one is active.

Use it before activate_document, or when tool calls seem to act on the wrong document. Needs: SolidWorks running. Read-only. Returns: documents (each with title, path, type and is_active) and count.

activate_documentA

Make an already-open document the active one, so the next tools act on it.

Match it by window title, full path or file name (not case-sensitive); see list_open_documents. To open a file that isn't open yet, use open_model. Needs: the document open in SolidWorks. Changes: the active document. Returns: data with activated (the title) and verified (read back from SolidWorks; null when it couldn't be read). No match is an error that lists the open documents.

save_body_as_partA

Save one solid body of the active multibody part as a new part file (Insert > Features > Save Bodies).

Use it to split a multibody part into parts, e.g. after create_extrusion without merging. Needs: an open, active part with the named body and an existing target folder. Changes: adds a Save Bodies feature to the part and writes the new .sldprt; closes any new, unsaved assembly SolidWorks opens alongside. Returns: data with body, file_path, feature, solid_bodies (every body name, to correct a wrong one) and closed_documents.

create_configurationA

Add a configuration to the active part or assembly, e.g. a long and a short version of one part.

A configuration holds its own dimension values and suppressed features; give parent to derive it from another. The configuration that was active stays active unless activate is on. Needs: an open part or assembly. Changes: adds a configuration. Returns: configuration with name, parent, active and every name in configurations.

activate_configurationA

Make a configuration of the active model the active one, and rebuild.

Dimensions and suppression then read and change in that configuration. Needs: an open part or assembly with that configuration. Changes: the active configuration. Returns: active and previous.

delete_configurationA

Delete a configuration of the active model; not the active one or the only one.

Activate another configuration first to delete the active one. Needs: an open part or assembly with that configuration. Changes: removes it. Returns: deleted and the configurations left.

generate_vba_extrusionA

Write a VBA macro that makes an extrusion with the full FeatureExtrusion options: both directions, draft, thin wall, end conditions.

Use it when create_extrusion doesn't cover an option you need, or to hand the step to someone as a macro. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_revolveA

Write a VBA macro that revolves the selected sketch, with both-direction and thin-wall options.

Use it when create_revolve doesn't cover an option you need. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_assembly_insertA

Write a VBA macro that inserts a component into the active assembly at a point.

To insert a component directly, use insert_component. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_drawing_viewsA

Write a VBA macro that places a model's standard views (front, top, right) on the active drawing.

To make a drawing directly, use generate_drawing_package or create_drawing_view. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_batch_exportA

Write a VBA macro that opens every matching file in a folder and saves a STEP copy of each to another folder.

To export one file directly, use export_step. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_part_modelingA

Write a VBA macro for a shell or a fillet on the active part.

Use it for a shell, which no direct tool makes yet; for a fillet, add_fillet works directly. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_assembly_matesA

Write a VBA macro that adds a concentric, distance, parallel, perpendicular or coincident mate between two selected faces or edges.

To add a mate directly, use add_mate. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. The faces must be selected in SolidWorks before the macro runs. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_drawing_dimensionsA

Write a VBA macro that adds a dimension to the selected drawing entities and sets its precision.

To bring the model's dimensions into a drawing directly, use insert_model_dimensions. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. The entities must be selected before the macro runs. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_file_operationsA

Write a VBA macro that sets a custom property in every configuration, or runs Pack and Go on the active document.

To set a property directly, use set_custom_property; for Pack and Go, use pack_and_go_assembly. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

generate_vba_macro_recorderA

Write a VBA starting point: a macro skeleton to fill in, or a note on starting and stopping SolidWorks' macro recorder.

Use "create_template" for an empty macro with the usual SolidWorks setup. Recording itself is done in SolidWorks (Tools > Macro > Record). The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

compare_templatesA

Compare two template files on disk: whether they are byte-identical, and how their sizes differ.

Use it to tell whether two templates are the same file. It does not read the templates' settings, so it can't say which properties or dimensions differ. Needs: both files on disk. Read-only. Returns: comparison with file_1 and file_2 (size, modified time, SHA-256), identical and size_delta_bytes.

execute_macroA

Run a SolidWorks macro (.swp, or legacy .swb), or VBA source text, in the running SolidWorks, calling its main procedure.

Use it for a macro file, or VBA you wrote as vba_source. Source runs only if the user set SOLIDWORKS_MCP_ALLOW_VBA_SOURCE to restricted or full, else vba_source_off: ask the user, never set it yourself. Restricted source may call SolidWorks on the open documents only, else vba_source_refused, naming each line. The reply gives source_file and the vba_source run. The macro must not wait for the user: a dialog still open after dialog_timeout s (30) is answered with Cancel or its only button, and the run fails as macro_waited_for_user; a Yes/No prompt is left. It runs repeat_count times, pause_between_runs s apart, stopping at the first failure. Needs: SolidWorks running. Changes: whatever the macro does; it can't be undone from here. Returns: runs_completed and data from the last run (macro_path, module_name, proc_name, errors).

discover_solidworks_docsA

Rebuild the SolidWorks API index on purpose. The lookups don't need it.

The lookup tools (lookup_api_method, lookup_api_interface, find_related_api_members, search_solidworks_api_help) build the index themselves on first use, so call this only to rebuild it, to read a specific SolidWorks year, or to save a copy elsewhere. It reads every interface in the installed SolidWorks type library (each member's parameters, return type and description), plus the VBA library references. SolidWorks must be installed, not running; it is never started or called. Changes: writes the index file, replacing the saved one.

Returns summary (interface, method and property counts), type_library (version, year and .tlb path), year and output_file, the saved index (megabytes, so it is not returned). Fails with a message naming the installed years when year isn't installed, or saying SolidWorks isn't installed here.

Example input: {"year": 2026}

search_solidworks_api_helpA

Search SolidWorks API interface and member names by keyword.

Use this when you don't know the exact name: "chamfer" finds IFeatureManager.InsertFeatureChamfer. Then call lookup_api_method on a match for its parameters and return type. Matches come from the SolidWorks type library installed on this machine.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first call builds the index (about a second) and later calls reuse it. index_status is ready (saved index), rebuilt (built for this call) or unavailable (no index could be built; guidance says why).

Returns matches (interface, member, member_type, score), guidance, and fallback_help suggesting MCP tools for the task, with year and type_library_version of the library that answered.

Example input: {"query": "chamfer", "max_results": 5}

lookup_api_methodA

Look up one SolidWorks API method or property: parameters, return type, description.

Use this before writing or debugging a SolidWorks API call (VBA, a macro or COM) to check that the member exists on that interface and how to call it. Answers come from the SolidWorks type library installed on this machine, so they match the installed version.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first lookup builds the index (about a second). index_status is ready, rebuilt or unavailable.

Names match regardless of case, as COM does. result.member is SolidWorks' own spelling, with a note when yours differs. Each parameter has a type and a direction: in, out (SolidWorks fills it) or in_out (pass a variable by reference). return_type is null when the method returns nothing; a property has its value type there and an access. result.found false means there is no such member, and result.note says why, including when no index could be built (SolidWorks isn't installed here, or the requested year isn't).

Example input: {"interface": "ISldWorks", "method": "OpenDoc6"}

lookup_api_interfaceA

List every method and property of a SolidWorks COM interface.

Use this to see what an interface offers, such as IFeatureManager, or to check which interface a member is really on before calling it. For one member's parameters, use lookup_api_method. Names match regardless of case.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first call builds the index (about a second) and later calls reuse it. index_status is ready (saved index), rebuilt (built for this call) or unavailable (no index could be built).

Returns result with methods, properties and their counts. result.found false means the interface isn't in the type library, or no index could be built, in which case result.note says why.

Example input: {"interface": "IFeatureManager"}

get_api_enumA

Look up a SolidWorks API enum's members and their integer values.

Use this when a call takes an enum value, such as a unit system or a user preference, instead of guessing the number: the values aren't in the API help pages. Give the enum (swUnitSystem_e) or one of its members (swUnitSystem_IPS); a member's name returns its whole enum with matched_member set. Names match regardless of case. The values come from SolidWorks' constants type library installed on this machine.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first lookup builds the index (about a second) and later ones reuse it. index_status is ready, rebuilt or unavailable.

Returns result with enum, description and members (name and value in declaration order). result.found false means there's no such enum or member, or no index could be built; result.note says which.

Example input: {"name": "swUnitSystem_e"}

find_related_api_membersA

Find SolidWorks API members related to an interface or member name.

For an interface: its own members. For a member: the other members of every interface that also has it (often used together), plus members whose names contain it. Use it to explore around a call you know, such as what sits beside InsertSketch.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first call builds the index (about a second) and later calls reuse it. index_status is ready (saved index), rebuilt (built for this call) or unavailable (no index could be built).

Returns result.related: each member's interface, name, type and why it is related. result.found false means nothing matched, or no index could be built, in which case result.note says why.

Example input: {"name": "InsertSketch", "max_results": 10}

reset_circuit_breakerA

Let calls through again to operations the server paused after repeated failures.

Use it when a tool returns error_type: circuit_open and you have fixed what made the calls fail (a missing sketch, a wrong reference): without a reset, the operation stays paused until its timeout. Resetting does not fix the cause; a call that fails again counts towards a new pause. Changes: only the server's own state; no SolidWorks document is touched. Returns: data with reset, the operations that were paused (empty when none were).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
solidworks-mcp/SKILL.mdHow to build and check SolidWorks parts, assemblies and drawings with the SolidWorks MCP server's tools. Use whenever you call its tools (create_part, create_sketch, create_extrusion, verify_model, generate_drawing_package and the rest), plan a CAD model, or recover from one of its errors.
solidworks-mcp/_manifestFile listing for solidworks-mcp

TDQS

A3.9/5.0

Scored across 157 tools

Disambiguation3/5

Each tool's description explicitly states its purpose and cross-references alternatives, which keeps most selections clear, but the surface carries several genuine near-duplicates: load_part/load_assembly vs open_model, save_part/save_assembly vs save_file, get_file_properties vs get_model_info, calculate_mass_properties vs get_mass_properties, and add_drawing_view vs create_drawing_view. Deprecated aliases mitigate the risk by naming their replacement, but an agent can still land on the superseded tool. The nine generate_vba_* tools plus create_* equivalents form another cluster that only the prose keeps apart.

Naming Consistency4/5

Names are uniformly snake_case with a verb-led convention across most of the surface (create_, add_, list_, get_, set_, export_, generate_, check_, verify_). A minority are noun-led or bare-noun patterns (sketch_mirror, sketch_trim, pattern_linear, mirror_feature, measure_entities), and add_fillet/add_chamfer vs add_sketch_fillet/add_sketch_chamfer show the sketch/solid split is expressed inconsistently. Still highly readable with only minor deviations.

Tool Count2/5

157 tools is far beyond a manageable surface; even for a full CAD application this is a large, layered API exposed at once. Deprecated aliases (load_part, save_part, calculate_mass_properties, get_file_properties, add_drawing_view, sketch_tutorial_simple_hole) and the redundant generate_vba_* family inflate the count without adding capability. The breadth of sub-domains justifies many tools, but not this many, and grouping/packs would help.

Completeness4/5

Coverage is unusually deep: sketching primitives and constraints, boss/cut extrude, revolve, sweep, loft, fillet/chamfer/draft/rib/shell, hole wizard, sheet metal with flat pattern and DXF export, assembly mates/components/patterns/interference, drawings with views, dimensions, GD&T, BOM, and a wide export set. Remaining gaps are modest (no cut-sweep/cut-loft, no body delete or combine/split beyond save_body_as_part, no delete_custom_property, no component delete), which agents can route around or handle via macros.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues