SolidWorks MCP

v2.2.0
io.github.andrewbartels1/solidworks-mcp-python Checked 1 hour ago Published 4 days ago

Drive SolidWorks from AI agents: parts, assemblies, drawings and export over the COM API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_model Open Model

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`.

ParameterTypeDescription
input_data *objectThe file. `file_path` (.sldprt, .sldasm or .slddrw) is required.

create_part Create Part

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.

ParameterTypeDescription
input_data *objectThe part. `name` is required but only a label: the reply gives SolidWorks' own name (Part1, ...); `template`, `units` (mm, cm, m, in, ft) and `material` (a name from `list_available_materials`) are op…

create_assembly Create Assembly

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.

ParameterTypeDescription
input_data *objectThe assembly. `name` is required but only a label: the reply gives SolidWorks' own name (Assem1, ...); `template` has a default.

create_drawing Create Drawing

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`.

ParameterTypeDescription
input_data *objectThe drawing. `name` is required but only a label: the reply gives SolidWorks' own name (Draw1, ...); `template` has a default.

close_model Close Model

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.

ParameterTypeDescription
input_data *objectThe close. Nothing is required: `save` is off.

create_extrusion Create Extrusion

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…

ParameterTypeDescription
input_data *objectThe extrusion. `depth` (mm) is required; `sketch_name`, `end_condition`, `both_directions`, `reverse_direction`, `draft_angle`, `thin_feature`/`thin_thickness` and `merge_result` have defaults.

create_revolve Create Revolve

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 `axis_entity`: the id `add_centerline` returned or a reference axis from `create_axis`. Left out, the centreline drawn in the sketch is the axis. 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 na…

ParameterTypeDescription
input_data *objectThe revolve. `angle` (degrees, 360 for a full turn) is required; `sketch_name`, `axis_entity`, `both_directions`, `reverse_direction`, `thin_feature` and `merge_result` have defaults.

get_dimension Get Dimension

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).

ParameterTypeDescription
input_data *objectThe dimension. Give `name` (or `dimension_name`), e.g. "D1@Boss-Extrude1".

set_dimension Set Dimension

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).

ParameterTypeDescription
input_data *objectThe change. `value` (mm) is required, with `name` (or `dimension_name`) such as "D1@Sketch1"; `units` is not used.

set_units Set Units

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`.

ParameterTypeDescription
input_data *objectThe units. `unit_system` (mm, cm, m, in or ft) is required.

create_cut_extrude Create Extruded Cut

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…

ParameterTypeDescription
input_data *objectThe cut. `depth` (mm) is required; `sketch_name`, `end_condition` (Blind, ThroughAll, ThroughAllBoth), `both_directions`, `reverse_direction` and `draft_angle` have defaults.

add_fillet Add Fillet

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`.

ParameterTypeDescription
input_data *objectThe fillet. `radius` (mm) is required; `edge_names` defaults to the current selection.

add_chamfer Add Chamfer

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`.

ParameterTypeDescription
input_data *objectThe chamfer. `distance` (mm) is required; `edge_names` defaults to the current selection.

create_sweep Create Sweep

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`.

ParameterTypeDescription
input_data *objectThe sweep. `path` (the path sketch's name) is required; `twist_along_path`, `twist_angle` (degrees) and `merge_result` have defaults.

create_loft Create Loft

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`.

ParameterTypeDescription
input_data *objectThe loft. `profiles` (sketch names, in order) is required; `guide_curves`, `start_tangent`, `end_tangent` and `merge_result` have defaults.

insert_component Insert Component

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.

ParameterTypeDescription
input_data *objectThe component. `file_path` is required; `x`, `y`, `z` (mm from the assembly origin) default to 0.

add_mate Add Mate

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`.

ParameterTypeDescription
input_data *objectThe mate. `component_a` and `component_b` are required; each side takes `entity_*` or `face_*` (default "Front Plane"); `mate_type` (coincident), `alignment`, `distance` (mm) and `angle` (degrees) hav…

set_component_state Set Component State

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`…

ParameterTypeDescription
input_data *objectThe component and what to change: `fixed`, `flexible`, `visible`, `transparent`, any of them.

list_components List Components

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_feature Delete Feature

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` an…

ParameterTypeDescription
input_data *objectThe feature. `name` (e.g. "Fillet1") is required.

suppress_feature Suppress or Unsuppress Feature

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).

ParameterTypeDescription
input_data *objectThe feature. `name` is required; `suppress` defaults to on (pass false to unsuppress).

rename_feature Rename Feature

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`.

ParameterTypeDescription
input_data *objectThe rename. `old_name` and `new_name` are required.

select_feature Select Feature

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`.

ParameterTypeDescription
input_data *objectThe selection. `feature_name` is required; `append` is off.

select_face_edges Select Face Edges

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`.

ParameterTypeDescription
input_data *objectThe face. Give exactly one of `point`, `side` or `plane`; `edge_type` (all) and `append` (off) have defaults.

rebuild_model Rebuild Model

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`.

ParameterTypeDescription
input_dataNothing is required: `top_level_only` is off (a full rebuild).

undo Undo

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`.

ParameterTypeDescription
input_dataNothing is required: `count` defaults to 1.

create_reference_plane Create Reference Plane

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.

ParameterTypeDescription
input_data *objectThe plane. Exactly one of `reference` and `face_point`; then `offset`, or `angle` with `axis`; `flip` is off.

create_axis Create Reference Axis

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.

ParameterTypeDescription
input_data *objectThe axis. `reference` ("x", "y" or "z") is required.

create_reference_point Create Reference Point

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.

ParameterTypeDescription
input_data *objectThe point. `mode` (along_curve or face_center) and `x`, `y`, `z` (mm) are required; for along_curve give one of `distance` (mm) or `percent`.

mirror_feature Mirror Feature

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).

ParameterTypeDescription
input_data *objectThe mirror. `features` (at least one name) and `mirror_plane` (e.g. "Right Plane") are required; `merge` and `mirror_bodies` are on.

pattern_circular Circular Pattern

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).

ParameterTypeDescription
input_data *objectThe pattern. `features` (at least one), `axis` and `count` (2 or more, the original included) are required; `angle` (360) and `equal_spacing` (on) have defaults.

pattern_linear Linear Pattern

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…

ParameterTypeDescription
input_data *objectThe pattern. `features`, `direction`, `count` (2+) and `spacing` (mm) are required; `direction2`, `count2` and `spacing2` make a grid.

create_shell Shell

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³).

ParameterTypeDescription
input_data *objectThe shell. `thickness` (mm) is required; `faces` lists a point on each face to remove; `outward` puts the wall outside.

add_draft Draft Faces

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³).

ParameterTypeDescription
input_data *objectThe draft. `angle` (degrees, under 90), `faces` (at least one point) and `neutral_face` (a point) are required.

create_rib Rib

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³).

ParameterTypeDescription
input_data *objectThe rib. `sketch` and `thickness` (mm) are required; `both_sides` is on.

create_base_flange Base Flange

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…

ParameterTypeDescription
input_data *objectThe flange. `thickness` and `bend_radius` (mm) are required; `k_factor` is 0.5; `depth` only for an open profile.

add_edge_flange Edge Flange

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³).

ParameterTypeDescription
input_data *objectThe flange. `edge_point` ([x, y, z] mm) and `length` (mm) are required; `angle` is 90 and the bend radius the sheet's.

create_sketched_bend Sketched Bend

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`.

ParameterTypeDescription
input_dataNothing is required: `angle` is 90, the bend radius the sheet's, and the sketch the last closed one.

set_flat_pattern Flat Pattern

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`.

ParameterTypeDescription
input_data`flat` is true (flatten); false folds the part back.

list_hole_sizes List Hole Wizard Sizes

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` a…

ParameterTypeDescription
input_data *objectWhat to list. `hole_type` is required; `standard` is iso.

create_hole Hole Wizard Hole

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 thro…

ParameterTypeDescription
input_data *objectThe hole. `face_point`, `hole_type` and `size` are required; `standard` is iso and `end_condition` through_all (blind needs `depth`).

add_cosmetic_thread Cosmetic Thread

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`.

ParameterTypeDescription
input_data *objectThe thread. `edge_point` and `size` are required; `diameter` comes from a metric size; blind (the default) needs `depth`.

list_equations List Equations

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_equation Set Equation

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:…

ParameterTypeDescription
input_data *object`name` and `expression` are required; `configurations` defaults to `all`.

delete_equation Delete Equation

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).

ParameterTypeDescription
input_data *object`name`, as `list_equations` gives it.

create_exploded_view Create Exploded View

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`.

ParameterTypeDescription
input_data *object`steps` (each `components`, `direction`, `distance`, `reverse`); empty explodes it automatically.

set_exploded_view Set Exploded View

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`.

ParameterTypeDescription
input_data *object`exploded` (true or false).

pattern_components Pattern Components

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 `…

ParameterTypeDescription
input_data *object`components`, `axis` and `count` are required; `kind` (`linear`) with `spacing`, or `circular` with `angle`.

mirror_components Mirror Components

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`.

ParameterTypeDescription
input_data *object`components` and `plane`, both required.

replace_component Replace Component

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`.

ParameterTypeDescription
input_data *object`component` and `file_path` are required; `all_instances` is off.

create_sketch Create Sketch

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_s…

ParameterTypeDescription
input_data *objectThe sketch. Exactly one of `plane` and `face_point`; `sketch_name` names it.

add_line Add Sketch Line

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.

ParameterTypeDescription
input_data *objectThe line. Give `x1`, `y1`, `x2`, `y2` (mm; or `start_x`, `start_y`, `end_x`, `end_y`); `construction` is off.

add_circle Add Sketch Circle

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.

ParameterTypeDescription
input_data *objectThe circle. `center_x`, `center_y` and `radius` (mm) are required; `construction` is off.

add_rectangle Add Sketch Rectangle

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.

ParameterTypeDescription
input_data *objectThe rectangle. Give `x1`, `y1`, `x2`, `y2` (mm; or `corner1_x` ... `corner2_y`); `construction` is off.

exit_sketch Exit Sketch

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_defined Check Sketch Fully Defined

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`).

ParameterTypeDescription
input_dataNothing is required: give `sketch_name`, or omit it for the open or last sketch.

add_arc Add Sketch Arc

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_ske…

ParameterTypeDescription
input_data *objectThe arc. `start_x`, `start_y`, `end_x` and `end_y` (mm) are required; `center_x`, `center_y` for `center`; `through_x`, `through_y` for `three_point`.

add_spline Add Sketch Spline

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`.

ParameterTypeDescription
input_data *objectThe spline. `points` (a list of {"x", "y"} in mm) is required.

add_centerline Add Sketch Centerline

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`.

ParameterTypeDescription
input_data *objectThe line. Give `x1`, `y1`, `x2`, `y2` (mm; or `start_x`, `start_y`, `end_x`, `end_y`); `construction` is not used.

add_polygon Add Sketch Polygon

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.

ParameterTypeDescription
input_data *objectA mapping: `center_x`, `center_y` (mm, default 0), `radius` (mm, circumscribed, default 10), `sides` (default 6) and `angle` (degrees the first corner is turned from +x, default 0).

add_ellipse Add Sketch Ellipse

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`.

ParameterTypeDescription
input_data *objectA mapping: `center_x`, `center_y` (mm, default 0), `major_axis` (default 20) and `minor_axis` (default 10), in mm, and `angle`, the major axis's turn from +x in degrees (default 0).

add_sketch_text Add Sketch Text

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 t…

ParameterTypeDescription
input_data *objectThe text. `text` is required; `x`, `y` (mm), `height` (3.5 mm) and `center_at` have defaults.

set_sketch_text Set Sketch Text

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).

ParameterTypeDescription
input_data *object`sketch_name` and `text`, both required.

add_sketch_constraint Add Sketch Relation

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 `id`s the add_* tools returned. Needs: an open sketch (`create_sketch`). Changes: adds the relation. Returns: `constraint` with `id`, `type` and the entities.

ParameterTypeDescription
input_data *objectThe relation. `entity1` and `relation_type` are required; `entity2` when the relation needs two, and `entity3` (the centreline) only for symmetric.

add_sketch_dimension Add Sketch Dimension

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 `id`s 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`…

ParameterTypeDescription
input_data *objectThe dimension. `entity1` and `value` (mm, or degrees for angular) are required; `entity2` and `dimension_type` (linear) have defaults.

sketch_linear_pattern Sketch Linear Pattern

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`.

ParameterTypeDescription
input_data *objectA mapping: `entities` (ids to repeat), `direction_x`/ `direction_y` (default 1, 0), `spacing` (mm, default 10) and `count` (instances, default 3).

sketch_circular_pattern Sketch Circular Pattern

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`.

ParameterTypeDescription
input_data *objectA mapping: `entities` (ids to repeat), `count` (instances, default 6) and `angle` (degrees spread over, default 360).

sketch_mirror Mirror Sketch Entities

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`.

ParameterTypeDescription
input_data *objectA mapping: `entities` (ids to mirror) and `mirror_line` (the centreline's id).

sketch_offset Offset Sketch Entities

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).

ParameterTypeDescription
input_data *objectA mapping: `entities` (ids to offset), `offset_distance` (mm, default 5) and `reverse_direction` (inward; default off).

sketch_convert_entities Convert Entities

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`.

ParameterTypeDescription
input_data *objectThe edges. Give `edge_points`, `face_point`, or both; `construction` makes the copies construction geometry.

add_sketch_fillet Add Sketch Fillet

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 fail…

ParameterTypeDescription
input_data *object`corners` (a list of `[x, y]` mm) and `radius` (mm).

add_sketch_chamfer Add Sketch Chamfer

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 w…

ParameterTypeDescription
input_data *object`corners` and `distance` (mm) are required; `distance2` (mm) or `angle` (degrees), not both.

add_slot Add Slot

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²).

ParameterTypeDescription
input_data *object`width` (mm), `start` and `end` (`[x, y]` mm) are required; `kind` is `straight`; `center` for an arc slot.

sketch_trim Trim Sketch Entity

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`.

ParameterTypeDescription
input_data *object`point`, `[x, y]` in sketch mm.

sketch_extend Extend Sketch Entity

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`.

ParameterTypeDescription
input_data *object`point`, `[x, y]` in sketch mm.

set_construction_geometry Set Construction Geometry

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.

ParameterTypeDescription
input_data *object`entities` (ids) is required; `construction` is on.

sketch_tutorial_simple_hole Tutorial: Hole Sketch

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_view Create Drawing View

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.

ParameterTypeDescription
input_data *objectThe view. `model_path` and `view_type` (front, back, left, right, top, bottom, isometric (iso), trimetric, dimetric or current) are required; `position_x`/`position_y` (mm on the sheet) and `scale` ha…

add_dimension Add Drawing Dimension

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).

ParameterTypeDescription
input_data *objectThe dimension. `dimension_type`, `entity1_point` and `position` are required; `entity2_point` for two entities.

add_note Add Drawing Note

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), `extent_mm` (the note's [left, bottom, right, top] on the sheet, read back) and `font_size_points`.

ParameterTypeDescription
input_data *objectThe note. `text`, `position_x` and `position_y` (the note's top-left corner, mm from the sheet's lower-left corner) are required; `font_size` (points) has a default.

create_section_view Create Section View

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`.

ParameterTypeDescription
input_data *objectThe section. `view`, `line_start`, `line_end` and `position` are required; `label` defaults to the next free letter.

create_detail_view Create Detail View

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`.

ParameterTypeDescription
input_data *objectThe detail. `view`, `center`, `radius` and `position` are required; `scale` is 2:1 and `label` the next free letter.

update_sheet_format Update Sheet Format

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`.

ParameterTypeDescription
input_data *objectThe format. `sheet_format` is required; `paper_size` optional.

auto_dimension_view Auto-Dimension Drawing View

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.

ParameterTypeDescription
input_data *objectThe view. `view` is required; `scheme` is baseline.

check_drawing Check Drawing Completeness

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…

create_technical_drawing Create Technical Drawing

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.

ParameterTypeDescription
input_data *objectThe model to draw. Give `model_file`; `projection` is third_angle unless you pass first_angle.

add_drawing_view Add Drawing View

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.

ParameterTypeDescription
input_data *objectThe view. Give `model_file` and `view_type` (front, back, left, right, top, bottom, isometric (iso), trimetric, dimetric or current); `position` ([x, y] mm on the sheet) and `scale` have defaults.

update_title_block Update Title Block

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`.

ParameterTypeDescription
input_data *objectAt least one of `title`, `drawing_number`, `drawn_by`, `drawn_date`, `revision`, `company`.

list_drawing_views List Drawing Views

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_marks Add Centre Marks

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.

ParameterTypeDescription
input_data *objectThe view. `view_name` is required; `mark_holes` and `mark_slots` default to on, `mark_fillets` to off.

add_balloons Add Balloons

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`.

ParameterTypeDescription
input_data *object`view_name` is required; `layout` is `square`.

compare_drawing_versions Compare Drawing Files

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`.

ParameterTypeDescription
input_data *objectBoth full paths, `drawing_version_1` and `drawing_version_2`; both are required.

insert_model_dimensions Insert Model Dimensions

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_adde…

ParameterTypeDescription
input_dataWhich views. Nothing is required: give `view_name` for one view, or omit it for every view; `include_hole_wizard` has a default.

arrange_dimensions Arrange Drawing Dimensions

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…

ParameterTypeDescription
input_dataWhich views. Nothing is required: give `view_name` for one view's dimensions, or omit it for every view.

insert_bom_table Insert BOM Table

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.

ParameterTypeDescription
input_dataThe table. `view_name` (a view of an assembly) is required; `bom_type` ("top_level_only", "parts_only" or "indented"), `template_path` and the position `x_mm`/`y_mm` (the sheet's BOM anchor when omitt…

add_gtol Add GD&T Frame

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`.

ParameterTypeDescription
input_dataThe frame. `characteristic` (position, flatness, perpendicularity, parallelism, profile_surface or concentricity) and `tolerance` are required, plus either the dimension or the sheet position; `diamet…

add_datum_tag Add Datum Tag

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`.

ParameterTypeDescription
input_dataThe tag. `label` (one letter), `attach_x_mm`/`attach_y_mm` (a point on the edge it marks) and `x_mm`/`y_mm` (where the tag goes) are all required, in mm on the sheet.

set_sheet_scale Set Sheet Scale

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`.

ParameterTypeDescription
input_dataThe scale. `numerator` and `denominator` are required and must be above zero, e.g. 1 and 2 for 1:2.

generate_drawing_package Generate Drawing Package

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 thos…

ParameterTypeDescription
input_dataThe drawing. `model_path` (.sldprt or .sldasm) is required; `output_dir`, the title-block fields (`title`, `drawing_number`, `author`, `revision`, `company`), `notes`, `include_isometric`, `include_bo…

list_model_dimensions List Model Dimensions

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`.

ParameterTypeDescription
input_dataNothing is required: give `feature_name` to list the dimensions that feature owns, or omit it for every dimension.

measure_entities Measure Entities

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_para…

ParameterTypeDescription
input_data *objectWhat to measure. `entities` (one or two) is required, each "face:x,y,z", "edge:x,y,z", "vertex:x,y,z" (a point on it, in metres) or a name like "Edge<1>".

get_material Get Material

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…

ParameterTypeDescription
input_dataNothing is required: `configuration` defaults to the active one; `material` (and `database`) read a library material instead.

set_material Set Material

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`.

ParameterTypeDescription
input_data *objectThe material. `material_name` is required; `database` ("SOLIDWORKS Materials") and `configuration` (all) have defaults.

list_available_materials List Available Materials

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.

ParameterTypeDescription
input_dataNothing is required: `search` filters by name or classification, not case-sensitive.

get_custom_properties Get Custom Properties

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).

ParameterTypeDescription
input_dataNothing is required: `configuration` reads that configuration's properties instead of the file's.

set_custom_property Set Custom Property

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`.

ParameterTypeDescription
input_data *objectThe property. `name` and `value` (text, or a link such as $PRP:"SW-Mass") are required; `configuration` defaults to file-level.

export_flat_pattern Export Flat Pattern

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`.

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .dxf or .dwg) is required.

get_mass_properties Get Mass Properties

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`.

ParameterTypeDescription
input_dataOptional, and empty: it always measures the active model.

calculate_mass_properties Calculate Mass Properties

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`.

ParameterTypeDescription
input_data *objectNothing: it always measures the active model.

check_interference Check Assembly Interference

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`.

ParameterTypeDescription
input_data *objectNothing is required. `components` limits the report to interferences involving those components; `include_hidden` also checks hidden components, which are left out by default.

verify_model Verify Model Against Expectations

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: suc…

ParameterTypeDescription
input_dataThe expectations, all optional: `mass_kg`, `volume_mm3`, `bounding_box_mm`, `feature_count`, `solid_body_count`, and for an assembly `component_count`, `mate_count` and `no_interference`; `relative_to…

export_step Export STEP

Write a STEP copy of the active document; it stays open on its own file. 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`.

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .step or .stp) is required; `format_type` is not needed: the file extension decides the format.

export_iges Export IGES

Write a IGES copy of the active document; it stays open on its own file. 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`.

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .igs or .iges) is required; `format_type` is not needed: the file extension decides the format.

export_stl Export STL

Write a STL copy of the active document; it stays open on its own file. 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).

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .stl) is required; `format_type` is not needed: the file extension decides the format.

export_pdf Export PDF

Write a PDF copy of the active document; it stays open on its own file. 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`.

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .pdf) is required; `format_type` is not needed: the file extension decides the format.

export_dwg Export DWG

Write a DWG copy of the active document; it stays open on its own file. 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`.

ParameterTypeDescription
input_data *objectThe export. `file_path` (ending in .dwg) is required; `format_type` is not needed: the file extension decides the format.

export_image Export Image

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`.

ParameterTypeDescription
input_data *objectThe image. `file_path` (or `output_path`) is needed; the format follows its extension. `width`/`height` (or `resolution` as "1920x1080") and `view_orientation` (isometric) have defaults.

generate_vba_code Generate VBA Code

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 macr…

ParameterTypeDescription
input_data *objectThe macro to write. Nothing is required: give `operation_description` (it also names the Sub) and `target_document` (Part, Assembly or Drawing); `include_error_handling` is on by default.

save_file Save File

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_pa…

ParameterTypeDescription
input_data *objectThe save. Nothing is required: give `file_path` to save to a new path, or omit it to save in place; `overwrite` is off.

save_as Save As

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 is File > Save As: the open document becomes the new file, and open assemblies that use it follow it to the new name. With `as_copy` it writes a copy instead and the original stays the open, referenced document. Any other `format_type` is an export: it writes a copy, and the open document keeps its own file. For one known format with its options, prefer `export_step`, `export_stl` and the other `export_*` tools. Needs: a…

ParameterTypeDescription
input_data *objectThe target. `file_path` is required; `format_type` defaults to "solidworks", and `overwrite` and `as_copy` are off.

save_as_template Save As Template

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…

ParameterTypeDescription
input_data *object`file_path` or `name` (one is required); `overwrite` is off.

get_file_properties Get File Properties

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_d…

get_model_info Get Model Info

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…

list_features List Features

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.

ParameterTypeDescription
input_data *objectWhat to list. Nothing is required: `include_suppressed` (off) and `max_assembly_depth` (2) have defaults.

get_selected_entities Get Selected Entities

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_tree Classify Feature Tree

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.

ParameterTypeDescription
input_data *objectWhat to classify. Nothing is required: pass `model_info` and `features` to classify them without reading the model; `include_suppressed` is off by default.

list_configurations List Configurations

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_part Load Part

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).

ParameterTypeDescription
input_data *objectThe part. `file_path` (a .sldprt) is required.

load_assembly Load Assembly

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).

ParameterTypeDescription
input_data *objectThe assembly. `file_path` (a .sldasm) is required.

save_part Save Part

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.

ParameterTypeDescription
input_dataThe save. Nothing is required: give `file_path` for a new path or omit it to save in place; `overwrite` is off.

save_assembly Save Assembly

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…

ParameterTypeDescription
input_dataThe save. Nothing is required: give `file_path` for a new path or omit it to save in place; `overwrite` and `include_references` are off.

pack_and_go_assembly Pack and Go Assembly

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 repla…

ParameterTypeDescription
input_data *objectThe copy. `source_path` (a .sldasm) and `target_dir` are required; `export_preview` and `overwrite` are off.

list_open_documents List Open Documents

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_document Activate Document

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.

ParameterTypeDescription
input_data *objectThe document. `title_or_path` is required.

save_body_as_part Save Body as Part

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`.

ParameterTypeDescription
input_data *objectThe body. `body_name` and `file_path` (a .sldprt) are required.

create_configuration Add Configuration

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`.

ParameterTypeDescription
input_data *objectThe configuration. `name` is required; `parent`, `description` and `activate` are optional.

activate_configuration Activate Configuration

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`.

ParameterTypeDescription
input_data *object`name`, the configuration to show.

delete_configuration Delete Configuration

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.

ParameterTypeDescription
input_data *object`name`, the configuration to delete.

generate_vba_extrusion Generate VBA: Extrusion

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`.

ParameterTypeDescription
input_data *objectThe extrusion. `depth` (mm) is required; everything else (`sketch_name`, draft, thin-wall and end-condition options) has a default.

generate_vba_revolve Generate VBA: Revolve

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`.

ParameterTypeDescription
input_data *objectThe revolve. Give `angle` in degrees (it defaults to 0, a revolve of nothing); `sketch_name`, `axis_reference`, both-direction and thin-wall options have defaults.

generate_vba_assembly_insert Generate VBA: Insert Component

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`.

ParameterTypeDescription
input_data *objectThe component. Give `component_path` (the .sldprt or .sldasm); `insertion_point` and `rotation` default to the origin.

generate_vba_drawing_views Generate VBA: Drawing Views

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`.

ParameterTypeDescription
input_data *objectThe views. Give `model_path` (the model to draw); `scale`, `sheet_format` and the view layout have defaults. The drawing must be open and active when the macro runs.

generate_vba_batch_export Generate VBA: Batch Export

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`.

ParameterTypeDescription
input_data *objectThe batch. Give `operation_type` (e.g. "export"), `file_pattern` (e.g. "*.sldprt"), `source_folder` and `target_folder`; `recursive` defaults to on.

generate_vba_part_modeling Generate VBA: Part Modeling

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`.

ParameterTypeDescription
input_data *objectA mapping with `operation`, "shell" (the default, with `thickness` in mm, default 2) or "fillet" (with `radius` in mm, default 5). Any other operation is refused.

generate_vba_assembly_mates Generate VBA: Assembly Mates

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`.

ParameterTypeDescription
input_data *objectA mapping with `mate_type` (default "concentric"), `component1` and `component2` (names, for the comments), and `distance` in mm for a distance mate.

generate_vba_drawing_dimensions Generate VBA: Drawing Dimensions

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`.

ParameterTypeDescription
input_data *objectA mapping with `dimension_type` ("linear", the default, "radial", "angular" or "diameter") and `precision` (decimal places, default 2).

generate_vba_file_operations Generate VBA: File Operations

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`.

ParameterTypeDescription
input_data *objectA mapping with `operation`: "custom_properties" (the default, with `property_name` and `property_value`) or "pack_and_go" (with `target_folder`). Any other operation is refused.

generate_vba_macro_recorder Generate VBA: Macro Recorder

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`.

ParameterTypeDescription
input_data *objectA mapping with `operation`: "start_recording" (the default), "stop_recording" or "create_template" (with `macro_name`). Any other operation is refused.

compare_templates Compare Templates

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`.

ParameterTypeDescription
input_data *objectThe two templates: `template1_path` and `template2_path`, both required.

execute_macro Run Macro

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 w…

ParameterTypeDescription
input_data *objectThe macro to run. Give `macro_path` (or `macro_file`), or `vba_source`; `proc_name` (main), `repeat_count` (1), `pause_between_runs` (0 s) and `dialog_timeout` (30 s) have defaults.

discover_solidworks_docs Rebuild SolidWorks API Index

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…

ParameterTypeDescription
input_dataThe rebuild. Nothing is required: `year` defaults to the installed release, `output_dir` to the index folder, and `include_vba` to on.

search_solidworks_api_help Search SolidWorks API

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; `…

ParameterTypeDescription
input_dataThe search. `query` (one or more words) is required; `max_results` and `year` have defaults.

lookup_api_method Look Up API Method

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. `…

ParameterTypeDescription
input_dataThe member to look up. `interface` (e.g. "ISldWorks") and `method` (a method or property name) are required; `year` has a default.

lookup_api_interface Look Up API Interface

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 `…

ParameterTypeDescription
input_dataThe interface. `interface` (e.g. "IFeatureManager") is required; `year` has a default.

get_api_enum Get API Enum

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 bu…

ParameterTypeDescription
input_dataThe enum. `name` (an enum or member name) is required; `year` has a default.

reset_circuit_breaker Reset Circuit Breaker

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).

ParameterTypeDescription
input_dataOptional: `operation` resets only that operation; leave it out to reset every one.