solidworks_mcp.adapters.mock_adapter¶
solidworks_mcp.adapters.mock_adapter ¶
Mock SolidWorks adapter for testing and development.
This adapter simulates SolidWorks operations for testing on non-Windows platforms or when SolidWorks is not available.
Attributes¶
MATERIAL_PROPERTIES
module-attribute
¶
MATERIAL_PROPERTIES: dict[str, tuple[str, str]] = {'elastic_modulus': ('EX', 'Pa'), 'poissons_ratio': ('NUXY', ''), 'shear_modulus': ('GXY', 'Pa'), 'tensile_strength': ('SIGXT', 'Pa'), 'yield_strength': ('SIGYLD', 'Pa'), 'compressive_strength': ('SIGXC', 'Pa'), 'density': ('DENS', 'kg/m^3'), 'thermal_expansion': ('ALPX', '1/K'), 'thermal_conductivity': ('KX', 'W/(m*K)'), 'specific_heat': ('C', 'J/(kg*K)')}
RELATION_NAME_MAP
module-attribute
¶
RELATION_NAME_MAP: dict[str, int] = {'horizontal': 4, 'vertical': 5, 'tangent': 6, 'parallel': 7, 'perpendicular': 8, 'coincident': 9, 'concentric': 10, 'symmetric': 11, 'equal': 14, 'fix': 17, 'collinear': 27}
_AXIS_PLANE_PAIRS
module-attribute
¶
_AXIS_PLANE_PAIRS: dict[str, tuple[str, str]] = {'x': ('Top Plane', 'Front Plane'), 'y': ('Front Plane', 'Right Plane'), 'z': ('Top Plane', 'Right Plane')}
_DEFAULT_ASSEMBLY_COMPONENTS
module-attribute
¶
_DEFAULT_ASSEMBLY_COMPONENTS: dict[str, dict[str, Any]] = {'PartA': {'type': 'Part', 'path': 'Mock://PartA.sldprt', 'features': [{'name': 'Boss-Extrude1', 'type': 'Extrusion', 'suppressed': False}, {'name': 'Fillet1', 'type': 'Fillet', 'suppressed': False}]}, 'PartB': {'type': 'Part', 'path': 'Mock://PartB.sldprt', 'features': [{'name': 'Cut-Extrude1', 'type': 'Cut', 'suppressed': False}]}, 'SubAssembly1': {'type': 'Assembly', 'path': 'Mock://SubAssembly1.sldasm', 'features': [{'name': 'Mate1', 'type': 'Mate', 'suppressed': False}], 'components': {'PartC': {'type': 'Part', 'path': 'Mock://PartC.sldprt', 'features': [{'name': 'Boss-Extrude1', 'type': 'Extrusion', 'suppressed': False}]}}}}
_NAMED_VIEWS
module-attribute
¶
Classes¶
AdapterHealth ¶
Bases: BaseModel
Health status information for adapters.
Attributes:
| Name | Type | Description |
|---|---|---|
average_response_time |
float
|
The average response time value. |
connection_status |
str
|
The connection status value. |
error_count |
int
|
The error count value. |
healthy |
bool
|
The healthy value. |
last_check |
datetime
|
The last check value. |
metrics |
dict[str, Any] | None
|
The metrics value. |
success_count |
int
|
The success count value. |
Methods:¶
__contains__ ¶
Build internal contains.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if contains, otherwise False. |
Source code in src/solidworks_mcp/adapters/base.py
__getitem__ ¶
Build internal getitem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
AdapterResult
dataclass
¶
AdapterResult(status: AdapterResultStatus, data: T | None = None, error: str | None = None, execution_time: float | None = None, metadata: dict[str, Any] | None = None)
Result wrapper for adapter operations.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
T | None
|
The data value. |
error |
str | None
|
The error value. |
execution_time |
float | None
|
The execution time value. |
metadata |
dict[str, Any] | None
|
The metadata value. |
status |
AdapterResultStatus
|
The status value. |
AdapterResultStatus ¶
Bases: StrEnum
Result status for adapter operations.
Attributes:
| Name | Type | Description |
|---|---|---|
ERROR |
Any
|
The error value. |
SUCCESS |
Any
|
The success value. |
TIMEOUT |
Any
|
The timeout value. |
WARNING |
Any
|
The warning value. |
ExtrusionParameters ¶
Bases: BaseModel
Parameters for extrusion operations.
Attributes:
| Name | Type | Description |
|---|---|---|
auto_select |
bool
|
The auto select value. |
both_directions |
bool
|
The both directions value. |
depth |
float
|
The depth value. |
draft_angle |
float
|
The draft angle value. |
end_condition |
str
|
The end condition value. |
feature_scope |
bool
|
The feature scope value. |
merge_result |
bool
|
The merge result value. |
reverse_direction |
bool
|
The reverse direction value. |
sketch_name |
str | None
|
Explicit sketch to operate on. When set, callers (e.g. create_cut_extrude) must select exactly this sketch and fail with a clear error if it doesn't exist rather than silently falling back to some other sketch. |
thin_feature |
bool
|
The thin feature value. |
thin_thickness |
float | None
|
The thin thickness value. |
thin_side |
str
|
Which side of the sketch a thin wall grows on:
|
up_to_surface |
str | None
|
The up to surface value. |
HoleSizeError ¶
Bases: InputRefused
A hole type or size the library doesn't have; names the nearest ones.
LoftParameters ¶
Bases: BaseModel
Parameters for loft operations.
Attributes:
| Name | Type | Description |
|---|---|---|
end_tangent |
str | None
|
The end tangent value. |
guide_curves |
list[str] | None
|
The guide curves value. |
merge_result |
bool
|
The merge result value. |
profiles |
list[str]
|
The profiles value. |
start_tangent |
str | None
|
The start tangent value. |
MassProperties ¶
Bases: BaseModel
Mass properties information.
Attributes:
| Name | Type | Description |
|---|---|---|
center_of_mass |
list[float]
|
The center of mass value. |
mass |
float
|
The mass value. |
moments_of_inertia |
dict[str, float]
|
The moments of inertia value. |
principal_axes |
dict[str, list[float]] | None
|
The principal axes value. |
surface_area |
float
|
The surface area value. |
volume |
float
|
The volume value. |
MockDrawingPackMixin ¶
Section and detail views, dimensions, format, title block, report.
Methods:¶
add_dimension
async
¶
add_dimension(dimension_type: str, entity1_point: list[float], position: list[float], entity2_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Mock dimension, measured between the points (fixed for circles).
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
auto_dimension_view
async
¶
Mock auto-dimension: two more dimensions on the view.
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
create_detail_view
async
¶
create_detail_view(view: str, center: list[float], radius: float, position: list[float], scale: str = '2:1', label: str | None = None) -> AdapterResult[dict[str, Any]]
Mock detail view: a new view named Detail View X (s:s).
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
create_section_view
async
¶
create_section_view(view: str, line_start: list[float], line_end: list[float], position: list[float], label: str | None = None) -> AdapterResult[dict[str, Any]]
Mock section view: a new view named Section View X-X.
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
drawing_report
async
¶
Mock report from the drawing's state.
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
update_sheet_format
async
¶
update_sheet_format(sheet_format: str, paper_size: str | None = None) -> AdapterResult[dict[str, Any]]
Mock format change: a0 to a4 ISO or ANSI names exist.
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
update_title_block
async
¶
Mock title block: the fields are kept for drawing_report.
Source code in src/solidworks_mcp/adapters/mock_drawing_pack.py
MockEquationsMixin ¶
list_equations, set_equation and delete_equation for the mock.
Methods:¶
delete_equation
async
¶
Delete an equation, as the real adapter does.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The equation's name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The deleted name and those left. |
Source code in src/solidworks_mcp/adapters/mock_equations.py
list_equations
async
¶
The active model's equations, as the real adapter lists them.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: Each with its value. |
Source code in src/solidworks_mcp/adapters/mock_equations.py
set_equation
async
¶
set_equation(name: str, expression: str, configurations: str | list[str] = 'all') -> AdapterResult[dict[str, Any]]
Add or change an equation, as the real adapter does.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A global variable, or a dimension such as |
required |
expression
|
str
|
The right-hand side. |
required |
configurations
|
str | list[str]
|
|
'all'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The equation, its value and action. |
Source code in src/solidworks_mcp/adapters/mock_equations.py
MockSheetMetalMixin ¶
Base flange, edge flanges, sketched bends and the flat blank, in memory.
Methods:¶
add_edge_flange
async
¶
add_edge_flange(edge_point: list[float], length: float, angle: float = 90.0, bend_radius: float | None = None, flip: bool = False) -> AdapterResult[dict[str, Any]]
Add a flange on one of the plate's long edges (|z| = 30).
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
create_base_flange
async
¶
create_base_flange(thickness: float, bend_radius: float, k_factor: float = 0.5, depth: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
Make the active part the mock plate.
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
create_sketched_bend
async
¶
create_sketched_bend(angle: float = 90.0, bend_radius: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
Fold half the plate up, as SolidWorks does (it keeps the +x half).
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
set_flat_pattern
async
¶
Flatten or fold the plate, and give its box.
Source code in src/solidworks_mcp/adapters/mock_sheet_metal.py
MockSolidWorksAdapter ¶
Bases: MockSheetMetalMixin, MockTemplatesMixin, MockDrawingPackMixin, MockEquationsMixin, SolidWorksAdapter
Mock adapter that simulates SolidWorks operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
object | None
|
Configuration values for the operation. Defaults to None. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
_connected |
Any
|
The connected value. |
_delays |
Any
|
The delays value. |
_is_connected_proxy |
Any
|
The is connected proxy value. |
_operation_count |
Any
|
The operation count value. |
_simulate_errors |
Any
|
The simulate errors value. |
Initialize the mock solid works adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
object | None
|
Configuration values for the operation. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
Methods:¶
__getattribute__ ¶
Build internal getattribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
activate_configuration
async
¶
Mock showing a configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The configuration to show. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The active and the previous one. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
activate_document
async
¶
Mock making an already-open document active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title_or_path
|
str
|
Title, full path, or file name of an open document. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
active_configuration
async
¶
Mock reading the active configuration's name.
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The name, or an error with no model open. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_arc
async
¶
add_arc(center_x: float, center_y: float, start_x: float, start_y: float, end_x: float, end_y: float, kind: str = 'center', through: tuple[float, float] | None = None) -> AdapterResult[str]
Mock adding a circular arc to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
Arc centre X. |
required |
center_y
|
float
|
Arc centre Y. |
required |
start_x
|
float
|
Arc start point X. |
required |
start_y
|
float
|
Arc start point Y. |
required |
end_x
|
float
|
Arc end point X. |
required |
end_y
|
float
|
Arc end point Y. |
required |
kind
|
str
|
|
'center'
|
through
|
tuple[float, float] | None
|
A point on a three-point arc. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_balloons
async
¶
Mock balloons: three, numbered 1 to 3.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_name
|
str
|
The view. |
required |
layout
|
str
|
The layout. |
'square'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_centerline
async
¶
Mock adding a construction centerline to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_chamfer
async
¶
add_chamfer(distance: float, edge_names: list[str], angle: float = 45.0, flip: bool = False) -> AdapterResult[SolidWorksFeature]
Mock angle-distance chamfer (see :meth:_mock_edge_feature).
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_circle
async
¶
Mock adding a circle to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
radius
|
float
|
The radius value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_cosmetic_thread
async
¶
add_cosmetic_thread(edge_point: list[float], size: str, diameter: float, end_type: str = 'blind', depth: float | None = None, standard: str = 'iso') -> AdapterResult[dict[str, Any]]
Mock cosmetic thread: a feature that leaves the volume alone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_point
|
list[float]
|
A point on the circular edge, mm. |
required |
size
|
str
|
The thread size. |
required |
diameter
|
float
|
The major diameter, mm. |
required |
end_type
|
str
|
Blind, up to next or through. |
'blind'
|
depth
|
float | None
|
Blind length, mm. |
None
|
standard
|
str
|
The standard. |
'iso'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The thread, volume unchanged. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_datum_tag
async
¶
add_datum_tag(label: str, attach_at_mm: tuple[float, float], x_mm: float, y_mm: float) -> AdapterResult[dict[str, Any]]
Mock adding a datum tag; refuses what the real one refuses.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_draft
async
¶
add_draft(angle: float, faces: list[list[float]], neutral_face: list[float], reverse: bool = False) -> AdapterResult[dict[str, Any]]
Mock draft: each drafted 40 x 40 mm face loses a thin wedge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
float
|
Draft angle, degrees. |
required |
faces
|
list[list[float]]
|
Points on the faces to draft. |
required |
neutral_face
|
list[float]
|
A point on the neutral face. |
required |
reverse
|
bool
|
Draft the other way. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The draft and its volume change. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_drawing_view
async
¶
Mock adding a view of a model to the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path and orientation. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_ellipse
async
¶
add_ellipse(center_x: float, center_y: float, major_axis: float, minor_axis: float, angle: float = 0.0) -> AdapterResult[str]
Mock adding an ellipse to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
Ellipse centre X in millimetres. |
required |
center_y
|
float
|
Ellipse centre Y in millimetres. |
required |
major_axis
|
float
|
Full major-axis length in millimetres. |
required |
minor_axis
|
float
|
Full minor-axis length in millimetres. |
required |
angle
|
float
|
The major axis's turn from +x, in degrees. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_fillet
async
¶
Mock constant-radius fillet (see :meth:_mock_edge_feature).
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_gtol
async
¶
add_gtol(characteristic: str, tolerance: float, x_mm: float, y_mm: float, diameter_zone: bool = False, material_condition: str = 'none', datums: list[str] | None = None, attach_at_mm: tuple[float, float] | None = None, dimension: tuple[str, str] | None = None) -> AdapterResult[dict[str, Any]]
Mock adding a feature control frame; refuses what the real one refuses.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_line
async
¶
Mock adding a line to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_mate
async
¶
add_mate(component_a: str, component_b: str, entity_a: str = 'Front Plane', entity_b: str = 'Front Plane', mate_type: str = 'coincident', alignment: str = 'aligned', distance: float = 0.0, angle: float = 0.0, face_a: list[float] | None = None, face_b: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Mock mating two components in the active assembly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_a
|
str
|
First component instance name. |
required |
component_b
|
str
|
Second component instance name. |
required |
entity_a
|
str
|
Named feature on the first component. Defaults to "Front Plane". |
'Front Plane'
|
entity_b
|
str
|
Named feature on the second component. Defaults to "Front Plane". |
'Front Plane'
|
mate_type
|
str
|
Mate type. Defaults to "coincident". |
'coincident'
|
alignment
|
str
|
Mate alignment. Defaults to "aligned". |
'aligned'
|
distance
|
float
|
Distance in millimetres, for a distance mate. Defaults to 0.0. |
0.0
|
angle
|
float
|
Angle in degrees, for an angle mate. Defaults to 0.0. |
0.0
|
face_a
|
list[float] | None
|
A point on a face of the first component (part coordinates, mm), used instead of entity_a. |
None
|
face_b
|
list[float] | None
|
The same for the second component. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 | |
add_note
async
¶
Mock placing a text note on the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the text and position. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_polygon
async
¶
add_polygon(center_x: float, center_y: float, radius: float, sides: int, angle: float = 0.0) -> AdapterResult[str]
Mock adding a regular polygon to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
Polygon centre X in millimetres. |
required |
center_y
|
float
|
Polygon centre Y in millimetres. |
required |
radius
|
float
|
Circumradius in millimetres (distance from centre
to each vertex; matches the real adapter's
|
required |
sides
|
int
|
Number of polygon sides. |
required |
angle
|
float
|
Degrees the first vertex is turned from +x. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_rectangle
async
¶
add_rectangle(x1: float, y1: float, x2: float, y2: float, from_center: bool = False) -> AdapterResult[str]
Mock adding a rectangle to sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
from_center
|
bool
|
|
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_sketch_chamfer
async
¶
add_sketch_chamfer(corners: list[list[float]], distance: float, distance2: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]
Mock bevelling sketch corners: one id per corner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corners
|
list[list[float]]
|
|
required |
distance
|
float
|
Distance along the first side, mm. |
required |
distance2
|
float | None
|
Distance along the second side, mm. |
None
|
angle
|
float | None
|
Angle from the first side, degrees. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_sketch_constraint
async
¶
add_sketch_constraint(entity1: str, entity2: str | None, relation_type: str, entity3: str | None = None) -> AdapterResult[str]
Mock adding a geometric constraint between sketch entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity1
|
str
|
Primary sketch-entity ID. |
required |
entity2
|
str | None
|
Secondary sketch-entity ID, or None for single-entity relations (horizontal, vertical, fix). |
required |
relation_type
|
str
|
Constraint name (see RELATION_NAME_MAP). |
required |
entity3
|
str | None
|
Third entity ID — only used by the
|
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: SUCCESS with a placeholder constraint ID, or ERROR if no active sketch, the relation_type is unsupported, arity is wrong, or an entity ID is unknown. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 | |
add_sketch_fillet
async
¶
Mock rounding sketch corners: one id per corner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corners
|
list[list[float]]
|
|
required |
radius
|
float
|
Fillet radius in mm. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_sketch_line
async
¶
add_sketch_line(x1: float, y1: float, x2: float, y2: float, construction: bool = False) -> AdapterResult[dict[str, Any]]
Legacy compatibility wrapper around add_line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
construction
|
bool
|
The construction value. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_sketch_text
async
¶
add_sketch_text(text: str, x: float = 0.0, y: float = 0.0, height: float = 3.5, center_at: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Mock adding sketch text: an id, the text as given, the height.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text; |
required |
x
|
float
|
Start x in mm (sketch coordinates). |
0.0
|
y
|
float
|
Start y in mm (the baseline). |
0.0
|
height
|
float
|
Letter height in mm. |
3.5
|
center_at
|
list[float] | None
|
A model point [x, y, z] in mm for the text's middle. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_slot
async
¶
add_slot(kind: str, width: float, start: list[float], end: list[float], center: list[float] | None = None) -> AdapterResult[str]
Mock drawing a slot: a new id; an arc slot needs its centre.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
required |
width
|
float
|
Slot width, mm. |
required |
start
|
list[float]
|
First centre (straight) or start (arc). |
required |
end
|
list[float]
|
Second centre (straight) or end (arc). |
required |
center
|
list[float] | None
|
The arc's centre (arc). |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The slot's id. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
add_spline
async
¶
Mock adding a NURBS spline through the supplied points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
list[dict[str, float]]
|
Ordered control points with
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
arrange_dimensions
async
¶
Mock arranging drawing dimensions: reports a clean layout.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
auto_center_marks
async
¶
auto_center_marks(view_name: str, mark_holes: bool = True, mark_fillets: bool = False, mark_slots: bool = True) -> AdapterResult[dict[str, Any]]
Mock auto-inserting centre marks on a drawing view.
The mock has no geometry, so it cannot know how many circular features a view holds - it mirrors the live adapter's refusals (not a drawing, no feature type selected, unknown view) and, on a valid request, records a nominal centre-mark increase per view so before/after deltas stay monotonic across calls.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_name
|
str
|
Name of a view on the active drawing. |
required |
mark_holes
|
bool
|
Mark holes / bores. |
True
|
mark_fillets
|
bool
|
Mark fillets. |
False
|
mark_slots
|
bool
|
Mark slots. |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The view, the feature types acted |
AdapterResult[dict[str, Any]]
|
on, and before/after centre-mark counts, or an error. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 | |
check_interference
async
¶
Mock checking the active assembly for interfering components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Any
|
Optional settings; |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
check_sketch_fully_defined
async
¶
Mock check for sketch definition status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch_name
|
str | None
|
Optional sketch name to inspect. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Definition status payload. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
close_model
async
¶
Mock closing the current model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save
|
bool
|
The save value. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
connect
async
¶
Mock connection to SolidWorks.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_assembly
async
¶
create_assembly(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Mock creating a new assembly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_axis
async
¶
Mock creating a reference axis along a principal direction.
Mirrors the live adapter's plane-pair mapping (_AXIS_PLANE_PAIRS
in solidworks/features.py, imported here directly so the two can
never drift apart) and validation: only x/y/z
(case-insensitive, leading ± stripped) are accepted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
"x", "y" or "z" (case-insensitive; leading ± stripped). |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The plane pair used and the |
AdapterResult[dict[str, Any]]
|
feature counter before/after, or error for an unknown reference. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_configuration
async
¶
create_configuration(name: str, parent: str | None = None, description: str = '', activate: bool = False) -> AdapterResult[dict[str, Any]]
Mock adding a configuration, as the real adapter does.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The new configuration's name. |
required |
parent
|
str | None
|
A configuration to derive it from, or None. |
None
|
description
|
str
|
Its description. |
''
|
activate
|
bool
|
Leave it active. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The configuration and every name. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_drawing
async
¶
create_drawing(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Mock creating a new drawing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_drawing_view
async
¶
Mock placing a view of a model on the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path and orientation. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_exploded_view
async
¶
Mock exploding the assembly: one view, the steps counted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
steps
|
list[dict[str, Any]] | None
|
The explode steps. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_extrusion
async
¶
create_extrusion(params: ExtrusionParameters | str, depth: float | None = None, direction: str | None = None) -> AdapterResult[SolidWorksFeature]
Mock creating an extrusion feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
ExtrusionParameters | str
|
The params value. |
required |
depth
|
float | None
|
The depth value. Defaults to None. |
None
|
direction
|
str | None
|
The direction value. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | |
create_hole
async
¶
create_hole(face_point: list[float], hole_type: str, standard: str, size: str, end_condition: str = 'through_all', depth: float | None = None, positions: list[list[float]] | None = None, fastener: str | None = None) -> AdapterResult[dict[str, Any]]
Mock holes: cylinders of the size's diameter, checked like the real ones.
The size is checked against :func:sample_library first, as the real
adapter checks the installed library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
face_point
|
list[float]
|
Where the hole goes, mm. |
required |
hole_type
|
str
|
The hole type. |
required |
standard
|
str
|
The standard. |
required |
size
|
str
|
The size. |
required |
end_condition
|
str
|
Blind or through all. |
'through_all'
|
depth
|
float | None
|
Blind depth, mm. |
None
|
positions
|
list[list[float]] | None
|
Further points, mm; one more hole each. |
None
|
fastener
|
str | None
|
The hole type's name; the default when |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The holes and their volume change, |
AdapterResult[dict[str, Any]]
|
or the nearest sizes for one the library lacks. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_loft
async
¶
Mock creating a loft feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
LoftParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_part
async
¶
create_part(name: str | None = None, units: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Mock creating a new part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
units
|
str | None
|
The units value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_reference_plane
async
¶
create_reference_plane(reference: str, offset: float = 0.0, angle: float = 0.0, flip: bool = False, axis: str | None = None, face_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Mock creating a reference plane offset from, angled to, or on a face.
Refuses exactly what the live adapter refuses (the shared
reference_plane_refusal in solidworks/features.py). On
success, invents a sequential PlaneN name tracked on
self._reference_planes and advances the shared mock feature-tree
counter so features_before/features_after differ by exactly
one, the same signal the live adapter derives from
IFeatureManager::GetFeatureCount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
Name of the reference plane. |
required |
offset
|
float
|
Offset distance in millimetres. Defaults to 0.0. |
0.0
|
angle
|
float
|
Angle in degrees about |
0.0
|
flip
|
bool
|
Reverse the offset direction. Defaults to False. |
False
|
axis
|
str | None
|
Axis to rotate about, for an angle. |
None
|
face_point
|
list[float] | None
|
Point on a flat face, in mm. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The new plane's name and |
AdapterResult[dict[str, Any]]
|
parameters, or error. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 | |
create_reference_point
async
¶
create_reference_point(mode: str, x: float, y: float, z: float, distance: float | None = None, percent: float | None = None) -> AdapterResult[dict[str, Any]]
Mock creating a reference point on the active part.
The mock has no geometry, so it cannot resolve a coordinate to an
edge/face - it mirrors the live adapter's validation (unknown mode,
the distance/percent XOR, range checks) and, on a valid request,
bumps the feature counter the way InsertReferencePoint would.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
"along_curve" or "face_center". |
required |
x
|
float
|
X of a point on the target entity, in millimetres. |
required |
y
|
float
|
Y of a point on the target entity, in millimetres. |
required |
z
|
float
|
Z of a point on the target entity, in millimetres. |
required |
distance
|
float | None
|
For "along_curve", offset from the edge start in millimetres. |
None
|
percent
|
float | None
|
For "along_curve", 0-100 of edge length. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The mode and feature counts, or an |
AdapterResult[dict[str, Any]]
|
error matching the live adapter's refusals. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 | |
create_revolve
async
¶
Mock creating a revolve feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
RevolveParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 | |
create_rib
async
¶
create_rib(sketch: str, thickness: float, both_sides: bool = True, flip_material: bool = False, normal_to_sketch: bool = False) -> AdapterResult[dict[str, Any]]
Mock rib: a 40 x 20 mm web of thickness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch
|
str
|
The rib sketch's name. |
required |
thickness
|
float
|
Rib thickness, mm. |
required |
both_sides
|
bool
|
Thicken both sides. |
True
|
flip_material
|
bool
|
Extend the other way. |
False
|
normal_to_sketch
|
bool
|
Extrude normal to the sketch. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The rib and its volume change. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_shell
async
¶
create_shell(thickness: float, faces: list[list[float]], outward: bool = False) -> AdapterResult[dict[str, Any]]
Mock shell: a 40 mm block hollowed to thickness walls.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thickness
|
float
|
Wall thickness, mm. |
required |
faces
|
list[list[float]]
|
Points on the faces to remove. |
required |
outward
|
bool
|
Add the wall outside. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The shell and its volume change. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_sketch
async
¶
create_sketch(plane: str | None, face_point: tuple[float, float, float] | None = None) -> AdapterResult[dict[str, Any]]
Mock creating a sketch on a plane, or on a face of the canned block.
With face_point, the point must lie on a face of the 10 mm block
select_face_edges models (every face of it is flat); any other
point is refused with the real adapter's message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plane
|
str | None
|
The plane value; None with |
required |
face_point
|
tuple[float, float, float] | None
|
A point in mm on a face of the block. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_standard_drawing
async
¶
create_standard_drawing(model_path: str, output_dir: str | None = None, title: str | None = None, subtitle: str | None = None, drawing_number: str | None = None, author: str = '', revision: str = 'A', company: str = '', drawn_date: str | None = None, notes: list[str] | None = None, include_isometric: bool = True, write_model_properties: bool = True, title_block_text_height_mm: float | None = None, include_bom: bool = False) -> AdapterResult[dict[str, Any]]
Mock standard A3 drawing: validates inputs, writes nothing to disk.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 | |
create_sweep
async
¶
Mock creating a sweep feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
SweepParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
create_technical_drawing
async
¶
Mock laying out the three standard views of a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path and projection. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
delete_configuration
async
¶
Mock deleting a configuration that isn't active or the only one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The configuration to delete. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The deleted name and those left. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
delete_feature
async
¶
Mock deleting a named feature from the active model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Feature or sketch name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
disconnect
async
¶
Mock disconnection from SolidWorks.
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
exit_sketch
async
¶
Mock exiting sketch mode.
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
export_file
async
¶
Mock exporting a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the target file. |
required |
format_type
|
str
|
The format type value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 | |
export_flat_pattern
async
¶
Mock flat-pattern export: validates the target, writes nothing.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
export_image
async
¶
Mock export of a PNG/JPG viewport screenshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
dict
|
The payload value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict]
|
AdapterResult[dict]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_application_info
async
¶
Mock SolidWorks description: a fixed 2026 install in English.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_custom_properties
async
¶
Mock reading custom properties.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_dimension
async
¶
Mock getting a dimension value; the mock's dimensions are lengths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_mass_properties
async
¶
Mock getting mass properties.
Returns:
| Type | Description |
|---|---|
AdapterResult[MassProperties]
|
AdapterResult[MassProperties]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_material
async
¶
get_material(configuration: str | None = None, material: str | None = None, database: str | None = None) -> AdapterResult[dict[str, Any]]
Mock reading the part's material, or a library material by name.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_model_geometry_summary
async
¶
Mock summary of the active part or assembly.
The mock has no geometry, so volume, bounding box and body count are
None ("not determinable") rather than invented numbers a caller
could mistake for a measurement. Component and mate counts are real:
they come from insert_component and add_mate this session.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_model_info
async
¶
Mock metadata for the currently active model.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
get_selected_entities
async
¶
Mock UI selection — always reports one canned face and one canned edge.
There's no real UI to read a selection from in mock mode, so this returns a stable, plausible-shaped fixture rather than an empty list, so callers exercising this tool in tests get realistic field names.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
health_check
async
¶
Get mock health status.
Returns:
| Name | Type | Description |
|---|---|---|
AdapterHealth |
AdapterHealth
|
The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
insert_bom_table
async
¶
insert_bom_table(view_name: str, template_path: str | None = None, bom_type: str = 'top_level_only', x_mm: float | None = None, y_mm: float | None = None) -> AdapterResult[dict[str, Any]]
Mock inserting a BOM table.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
insert_component
async
¶
insert_component(file_path: str, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> AdapterResult[dict[str, Any]]
Mock inserting a component into the active assembly.
Records the component in self._components so repeated inserts
accumulate and list_components reflects them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the part or sub-assembly to insert. |
required |
x
|
float
|
X position in millimetres. Defaults to 0.0. |
0.0
|
y
|
float
|
Y position in millimetres. Defaults to 0.0. |
0.0
|
z
|
float
|
Z position in millimetres. Defaults to 0.0. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
insert_model_dimensions
async
¶
insert_model_dimensions(view_name: str | None = None, include_hole_wizard: bool = True) -> AdapterResult[dict[str, Any]]
Mock importing model dimensions: three per view, never twice.
Mirrors the live result shape (views, dimensions_added,
unique_dimensions, skipped_pictorial_views, method,
autodimension_status) and its refusals.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
is_connected ¶
Check if mock connection is active.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if connected, otherwise False. |
list_available_materials
async
¶
Mock listing the material library, with the live metadata.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_components
async
¶
Mock listing the top-level components of the active assembly.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_configurations
async
¶
Mock configuration listing for the active model.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_drawing_views
async
¶
Mock listing the views on the active drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_features
async
¶
list_features(include_suppressed: bool = False, max_assembly_depth: int = 2) -> AdapterResult[list[dict[str, Any]]]
Mock feature tree listing for the active model.
For an Assembly model, flattens in every configured component's
features (see _assembly_components) alongside the document's own
features, tagged with component/component_path the same way
the real adapter does. Falls back to a small canned two-component
fixture (plus one nested sub-assembly) when no components have been
configured, mirroring the existing "seed realistic feature names"
behavior for an empty Part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_suppressed
|
bool
|
The include suppressed value. Defaults to False. |
False
|
max_assembly_depth
|
int
|
Sub-assembly recursion budget. Ignored for non-Assembly models. Defaults to 2. |
2
|
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | |
list_hole_sizes
async
¶
list_hole_sizes(standard: str, hole_type: str, fastener: str | None = None, size: str | None = None) -> AdapterResult[dict[str, Any]]
Mock Hole Wizard library: a few real ISO and ANSI inch sizes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
standard
|
str
|
The standard. |
required |
hole_type
|
str
|
The kind of hole. |
required |
fastener
|
str | None
|
One hole type's name. |
None
|
size
|
str | None
|
One size, for its dimensions. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: As the real adapter's, from |
AdapterResult[dict[str, Any]]
|
func: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_model_dimensions
async
¶
Mock listing model dimensions from the tracked dimension table.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
list_open_documents
async
¶
Mock enumerating the currently open documents.
Returns every model the mock has created or opened this session, with
is_active reflecting self._current_model.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: The result produced by the |
AdapterResult[list[dict[str, Any]]]
|
operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
measure_entities
async
¶
Mock measuring: nominal values with the live adapter's validation.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
mirror_components
async
¶
Mock mirroring: one new instance per component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[str]
|
The components. |
required |
plane
|
str
|
The plane. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
mirror_feature
async
¶
mirror_feature(features: list[str], mirror_plane: str, merge: bool = True, mirror_bodies: bool = True) -> AdapterResult[dict[str, Any]]
Mock mirroring solid bodies or features about a plane.
The mock has no geometry engine, so it cannot measure a real volume
change - it mirrors the live adapter's refusals instead of
fabricating a result it cannot know. An empty source list or plane
name is rejected outright (matching _mirror_feature_impl in
solidworks/features.py verbatim), and a source or plane name
that was never created in this session is rejected the same way
_select_named_feature / _select_reference_entity would fail
to select it there.
On success, the tracked self._mirror_volume figure (seeded at
the live-measured 1819569.1 mm^3 wing volume) is doubled, matching
the ~2.0 ratio a correct mirror produces (measured live: 1.998528
for a lofted wing, exactly 2.0 for a boss whose sketch sits on the
plane).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
list[str]
|
Body or feature names to mirror. |
required |
mirror_plane
|
str
|
Plane name to mirror about. |
required |
merge
|
bool
|
Merge the mirrored result with the original. Defaults to True. |
True
|
mirror_bodies
|
bool
|
Mirror whole bodies rather than features. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The mirror feature's name, inputs |
AdapterResult[dict[str, Any]]
|
and volume before/after, or error. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 | |
open_model
async
¶
Mock opening a SolidWorks model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the target file. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Raises:
| Type | Description |
|---|---|
SolidWorksOperationError
|
Simulated adapter failure. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
pack_and_go_assembly
async
¶
Mock Pack-and-Go: simulate copying an assembly to a target directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_path
|
str
|
Path to the source .sldasm file. |
required |
target_dir
|
str
|
Directory to copy files into. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict]
|
AdapterResult[dict]: Simulated pack-and-go result. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
pattern_circular
async
¶
pattern_circular(features: list[str], axis: str, count: int, angle: float = 360.0, equal_spacing: bool = True) -> AdapterResult[dict[str, Any]]
Mock patterning features around an axis.
The mock has no geometry engine, so it cannot measure a real volume
change - it mirrors the live adapter's refusals instead of
fabricating a result it cannot know (matching
_pattern_circular_impl in solidworks/features.py verbatim
for the three argument checks below). An axis name that was never
created via create_axis in this session is rejected the same
way SelectByID2 would fail to select it there.
On success, the tracked self._pattern_volume figure (seeded at
the live-measured 48431.5 mm^3 hub+blade volume) grows by
_PATTERN_BLADE_VOLUME * (count - 1), the live-derived
per-instance volume, so volume_before/volume_after/volume_ratio
stay self-consistent and scale with count roughly the way
adding more blades to the hub would - reproducing the live
48431.5 -> 75916.4 mm^3 measurement exactly for count=4.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
list[str]
|
Names of the features to pattern. |
required |
axis
|
str
|
Name of the axis to rotate about. |
required |
count
|
int
|
Total number of instances including the original. |
required |
angle
|
float
|
Total angle in degrees to spread them over. Defaults to 360.0. |
360.0
|
equal_spacing
|
bool
|
Space instances evenly across |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The pattern's name, inputs and |
AdapterResult[dict[str, Any]]
|
volume before/after, or error. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 | |
pattern_components
async
¶
pattern_components(components: list[str], axis: str, count: int, kind: str = 'linear', spacing: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]
Mock a component pattern: (count - 1) new instances per seed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[str]
|
The seeds. |
required |
axis
|
str
|
The axis. |
required |
count
|
int
|
Instances, seeds included. |
required |
kind
|
str
|
|
'linear'
|
spacing
|
float | None
|
Linear spacing, mm. |
None
|
angle
|
float | None
|
Circular angle, degrees. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
pattern_linear
async
¶
pattern_linear(features: list[str], direction: list[float] | str, count: int, spacing: float, direction2: list[float] | str | None = None, count2: int = 1, spacing2: float = 0.0, reverse: bool = False, reverse2: bool = False) -> AdapterResult[dict[str, Any]]
Mock linear pattern: each extra instance adds a 1000 mm³ seed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
list[str]
|
Names of the features to repeat. |
required |
direction
|
list[float] | str
|
The first direction (a point or a name). |
required |
count
|
int
|
Instances along it, the original included. |
required |
spacing
|
float
|
Spacing, mm. |
required |
direction2
|
list[float] | str | None
|
The second direction, or None. |
None
|
count2
|
int
|
Instances along the second direction. |
1
|
spacing2
|
float
|
Spacing along it, mm. |
0.0
|
reverse
|
bool
|
Flip the first direction. |
False
|
reverse2
|
bool
|
Flip the second direction. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The pattern and its volume change. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
rebuild_model
async
¶
Mock rebuild with the real adapter's diagnostics contract.
Clean by default; issues placed in injected_rebuild_issues are
explained with the same rebuild_diagnostics logic the real
adapter uses, so ERROR-with-data / warnings-only behave identically.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
rename_feature
async
¶
Mock renaming a named feature in the active model.
Mirrors the real adapter: an empty target name, an unknown feature, or a target name already in use are all errors; renaming to the current name is a no-op success.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
old_name
|
str
|
Current feature name. |
required |
new_name
|
str
|
New feature name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 | |
replace_component
async
¶
replace_component(component: str, file_path: str, all_instances: bool = False) -> AdapterResult[dict[str, Any]]
Mock replacing: the component now uses file_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
The instance. |
required |
file_path
|
str
|
The new file. |
required |
all_instances
|
bool
|
Every instance. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/mock_adapter.py
save_body_as_part
async
¶
Mock extracting a solid body from the active part to a new file.
The mock has no bodies, so it cannot validate body_name against
real geometry - it mirrors the live adapter's other refusals (no
model, not a part, blank arguments, missing parent directory) and, on
a valid request, writes an empty placeholder file so callers and
tests can observe the side effect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body_name
|
str
|
Name of a solid body in the active part. |
required |
file_path
|
str
|
Absolute path for the new |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The body, the written path, and a |
AdapterResult[dict[str, Any]]
|
single-element body list, or an error. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 | |
save_copy
async
¶
Mock writing a copy; the open document keeps its path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Where the copy goes. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The copy's path and the open one. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
save_file
async
¶
Legacy compatibility save operation for tests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | None
|
Path to the target file. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
select_face_edges
async
¶
select_face_edges(point: list[float] | None = None, side: str | None = None, plane: str | None = None, edge_type: str = 'all', append: bool = False) -> AdapterResult[dict[str, Any]]
Mock face-edge multi-selection on a canned 10 mm block.
Mirrors the real adapter's contract: the same input validation, the
same payload shape, and the same failure cases. The block spans
0..10 mm on every axis; the +Z/-Z faces carry a 2 mm radius hole rim
once any circle has been sketched, so edge_type="circular"
behaves like a real drilled part. Front Plane (z = 0) is the only
reference plane with a face on it.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | |
select_feature
async
¶
Mock feature selection, mirroring the real adapter's contract.
Succeeds only for names the mock is tracking for the active model
(created features, sketches, default planes); anything else is an
ERROR naming the feature - never SUCCESS with selected: False.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_name
|
str
|
The feature name, optionally |
required |
append
|
bool
|
Add to the current selection. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_component_appearance
async
¶
set_component_appearance(component: str, visible: bool | None = None, transparent: bool | None = None) -> AdapterResult[dict[str, Any]]
Mock hiding, showing and transparency: the states as asked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
The instance. |
required |
visible
|
bool | None
|
Show or hide. |
None
|
transparent
|
bool | None
|
Transparent or opaque. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_component_state
async
¶
set_component_state(component: str, fixed: bool | None = None, flexible: bool | None = None) -> AdapterResult[dict[str, Any]]
Mock fixing, floating and flexing a component.
Tracks each component's state on self._component_states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
Instance name. |
required |
fixed
|
bool | None
|
True fixes it, False floats it. |
None
|
flexible
|
bool | None
|
True flexible, False rigid. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The state before and after. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_construction_geometry
async
¶
set_construction_geometry(entities: list[str], construction: bool = True) -> AdapterResult[dict[str, Any]]
Mock setting construction geometry: known ids only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
Sketch entity ids. |
required |
construction
|
bool
|
Construction or normal. |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_custom_property
async
¶
set_custom_property(name: str, value: str, configuration: str | None = None) -> AdapterResult[dict[str, Any]]
Mock writing one custom property.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_dimension
async
¶
set_dimension(name: str, value: float, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]
Mock setting a dimension value, per configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
value
|
float
|
The value value. |
required |
configurations
|
str | list[str]
|
"this", "all" or names. |
'this'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_exploded_view
async
¶
Mock showing or collapsing the exploded view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exploded
|
bool
|
Explode or collapse. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_material
async
¶
set_material(material_name: str, database: str | None = None, configuration: str | None = None) -> AdapterResult[dict[str, Any]]
Mock assigning a material; unknown names fail as they do live.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_sheet_scale
async
¶
Mock setting the sheet scale.
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_sketch_text
async
¶
Mock rewriting a sketch's text: the text given, before and after.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch_name
|
str
|
The sketch. |
required |
text
|
str
|
The new text. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
set_units
async
¶
Mock setting the active document's linear unit system.
Mirrors the real adapter: an unrecognised token is an error, and the
applied token is recorded on the current model's properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit_system
|
str
|
One of |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
sketch_circular_pattern
async
¶
Mock creating a circular sketch pattern around the sketch origin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
Seed entity IDs. |
required |
angle
|
float
|
Total swept angle in degrees. |
required |
count
|
int
|
Total number of instances (including the seed). |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
sketch_convert_entities
async
¶
sketch_convert_entities(edge_points: list[list[float]] | None = None, face_point: list[float] | None = None, construction: bool = False) -> AdapterResult[dict[str, Any]]
Mock convert entities: one line per edge, four for a face.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_points
|
list[list[float]] | None
|
Points on the edges to copy. |
None
|
face_point
|
list[float] | None
|
A point on a face whose outline to copy. |
None
|
construction
|
bool
|
Make the copies construction geometry. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The new entity ids. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
sketch_extend
async
¶
Mock extending at a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
list[float]
|
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
sketch_linear_pattern
async
¶
sketch_linear_pattern(entities: list[str], direction_x: float, direction_y: float, spacing: float, count: int) -> AdapterResult[str]
Mock creating a linear sketch pattern.
Mirrors the real adapter's validation rules — empty entities, count < 2, non-positive spacing, and a zero direction vector each produce a clear error without "creating" a pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
Seed entity IDs. |
required |
direction_x
|
float
|
Pattern direction X component. |
required |
direction_y
|
float
|
Pattern direction Y component. |
required |
spacing
|
float
|
Distance between instances in millimetres. |
required |
count
|
int
|
Total number of instances (including the seed). |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 | |
sketch_mirror
async
¶
Mock mirroring sketch entities about a centerline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
IDs of segments to mirror. |
required |
mirror_line
|
str
|
ID of the centerline to mirror across. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 | |
sketch_offset
async
¶
sketch_offset(entities: list[str], offset_distance: float, reverse_direction: bool) -> AdapterResult[str]
Mock offsetting sketch entities by a fixed distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
IDs of segments to offset. |
required |
offset_distance
|
float
|
Distance in millimetres. Must be > 0. |
required |
reverse_direction
|
bool
|
Flip the offset direction. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
sketch_trim
async
¶
Mock trimming at a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
list[float]
|
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
suppress_feature
async
¶
suppress_feature(name: str, suppress: bool = True, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]
Mock suppressing or unsuppressing a named feature, per configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Feature name. |
required |
suppress
|
bool
|
True to suppress, False to unsuppress. |
True
|
configurations
|
str | list[str]
|
"this", "all" or names. |
'this'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
undo
async
¶
Mock undoing the last operations in the active model.
Removes the most recently added features, mirroring what an undo of
feature-creation steps does to the tree. tree_changed is False
when there was nothing left to undo, which is what the real adapter
reports too - SolidWorks accepts an undo on an empty stack quietly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of steps to undo. |
1
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
MockTemplatesMixin ¶
get_template_folders and save_as_template for the mock.
Methods:¶
get_template_folders
async
¶
The mock's template folders and the active document's extension.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/mock_templates.py
save_as_template
async
¶
Record the active document's settings as a template at file_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The template's path, with the document's extension. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The same shape as the real adapter's. |
Source code in src/solidworks_mcp/adapters/mock_templates.py
RevolveParameters ¶
Bases: BaseModel
Parameters for revolve operations.
Attributes:
| Name | Type | Description |
|---|---|---|
angle |
float
|
The angle value. |
both_directions |
bool
|
The both directions value. |
merge_result |
bool
|
The merge result value. |
reverse_direction |
bool
|
The reverse direction value. |
thin_feature |
bool
|
The thin feature value. |
thin_thickness |
float | None
|
The thin thickness value. |
sketch_name |
str | None
|
The sketch to revolve, by its tree name;
|
axis_entity |
str | None
|
The axis to revolve about: a sketch line's
id ( |
SolidWorksAdapter ¶
Bases: ABC
Base adapter interface for SolidWorks integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
object | None
|
Configuration values for the operation. Defaults to None. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
_metrics |
Any
|
The metrics value. |
config |
Any
|
The config value. |
config_dict |
Any
|
The config dict value. |
Initialize adapter with configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
object | None
|
Configuration values for the operation. Defaults to None. |
None
|
Source code in src/solidworks_mcp/adapters/base.py
Methods:¶
activate_configuration
async
¶
Make a configuration active.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
activate_document
async
¶
Make an already-open document the active one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title_or_path
|
str
|
Title, full path, or file name of an open document. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: What was activated, or error. |
Source code in src/solidworks_mcp/adapters/base.py
active_configuration
async
¶
Read the active configuration's name.
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
add_arc
async
¶
add_arc(center_x: float, center_y: float, start_x: float, start_y: float, end_x: float, end_y: float, kind: str = 'center', through: tuple[float, float] | None = None) -> AdapterResult[str]
Add an arc to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
start_x
|
float
|
The start x value. |
required |
start_y
|
float
|
The start y value. |
required |
end_x
|
float
|
The end x value. |
required |
end_y
|
float
|
The end y value. |
required |
kind
|
str
|
|
'center'
|
through
|
tuple[float, float] | None
|
A point on a three-point arc. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_balloons
async
¶
Number a drawing view's parts with balloons, one per part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_name
|
str
|
The drawing view. |
required |
layout
|
str
|
|
'square'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_centerline
async
¶
Add a centerline to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_chamfer
async
¶
add_chamfer(distance: float, edge_names: list[str], angle: float = 45.0, flip: bool = False) -> AdapterResult[Any]
Add an angle-distance chamfer to the named or selected edges.
At the default 45 degrees both legs equal distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distance
|
float
|
Chamfer distance in millimeters, along one face. |
required |
edge_names
|
list[str]
|
List of edge names to chamfer. |
required |
angle
|
float
|
Chamfer angle in degrees. Defaults to 45. |
45.0
|
flip
|
bool
|
Measure |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
AdapterResult |
AdapterResult[Any]
|
Feature result or error. |
Source code in src/solidworks_mcp/adapters/base.py
add_circle
abstractmethod
async
¶
Add a circle to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
radius
|
float
|
The radius value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_cosmetic_thread
async
¶
add_cosmetic_thread(edge_point: list[float], size: str, diameter: float, end_type: str = 'blind', depth: float | None = None, standard: str = 'iso') -> AdapterResult[dict[str, Any]]
Add a cosmetic thread on a circular edge.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
add_datum_tag
async
¶
add_datum_tag(label: str, attach_at_mm: tuple[float, float], x_mm: float, y_mm: float) -> AdapterResult[dict[str, Any]]
Add a datum feature symbol on a drawing edge.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
add_dimension
async
¶
add_dimension(dimension_type: str, entity1_point: list[float], position: list[float], entity2_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Add one dimension between drawing entities picked at sheet points.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
add_draft
async
¶
add_draft(angle: float, faces: list[list[float]], neutral_face: list[float], reverse: bool = False) -> AdapterResult[dict[str, Any]]
Draft faces against a neutral face.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
add_drawing_view
async
¶
Add a view of a model to the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path, orientation, position in millimetres and optional view scale. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The new view's details, or error. |
Source code in src/solidworks_mcp/adapters/base.py
add_edge_flange
async
¶
add_edge_flange(edge_point: list[float], length: float, angle: float = 90.0, bend_radius: float | None = None, flip: bool = False) -> AdapterResult[dict[str, Any]]
A flange off the sheet edge nearest a point.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
add_ellipse
async
¶
add_ellipse(center_x: float, center_y: float, major_axis: float, minor_axis: float, angle: float = 0.0) -> AdapterResult[str]
Add an ellipse to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
major_axis
|
float
|
The major axis value. |
required |
minor_axis
|
float
|
The minor axis value. |
required |
angle
|
float
|
The major axis's turn from +x, in degrees. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_fillet
async
¶
Add a fillet feature to selected edges.
Rounds the selected edges of the current solid body with the given radius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
Fillet radius in millimeters. |
required |
edge_names
|
list[str]
|
List of edge names to fillet. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AdapterResult |
AdapterResult[Any]
|
Feature result or error. |
Source code in src/solidworks_mcp/adapters/base.py
add_gtol
async
¶
add_gtol(characteristic: str, tolerance: float, x_mm: float, y_mm: float, diameter_zone: bool = False, material_condition: str = 'none', datums: list[str] | None = None, attach_at_mm: tuple[float, float] | None = None, dimension: tuple[str, str] | None = None) -> AdapterResult[dict[str, Any]]
Add a GD&T feature control frame to the active drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
add_line
abstractmethod
async
¶
Add a line to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value. |
required |
y1
|
float
|
The y1 value. |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_mate
async
¶
add_mate(component_a: str, component_b: str, entity_a: str = 'Front Plane', entity_b: str = 'Front Plane', mate_type: str = 'coincident', alignment: str = 'aligned', distance: float = 0.0, angle: float = 0.0, face_a: list[float] | None = None, face_b: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Mate two components together in the active assembly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_a
|
str
|
First component instance name. |
required |
component_b
|
str
|
Second component instance name. |
required |
entity_a
|
str
|
Named feature on the first component. Defaults to "Front Plane". |
'Front Plane'
|
entity_b
|
str
|
Named feature on the second component. Defaults to "Front Plane". |
'Front Plane'
|
mate_type
|
str
|
Mate type, e.g. |
'coincident'
|
alignment
|
str
|
|
'aligned'
|
distance
|
float
|
Distance in millimetres, for a distance mate. Defaults to 0.0. |
0.0
|
angle
|
float
|
Angle in degrees, for an angle mate. Defaults to 0.0. |
0.0
|
face_a
|
list[float] | None
|
A point on a face of the first
component, in its part coordinates (mm), used instead of
|
None
|
face_b
|
list[float] | None
|
The same for the second component. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Mate details, or error. |
Source code in src/solidworks_mcp/adapters/base.py
add_note
async
¶
Place a text note on the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the note text, its position in millimetres and an optional font size in points. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The note's details, or error. |
Source code in src/solidworks_mcp/adapters/base.py
add_polygon
async
¶
add_polygon(center_x: float, center_y: float, radius: float, sides: int, angle: float = 0.0) -> AdapterResult[str]
Add a regular polygon to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
radius
|
float
|
The radius value. |
required |
sides
|
int
|
The sides value. |
required |
angle
|
float
|
Degrees the first vertex is turned from +x. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_rectangle
abstractmethod
async
¶
add_rectangle(x1: float, y1: float, x2: float, y2: float, from_center: bool = False) -> AdapterResult[str]
Add a rectangle to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
float
|
The x1 value (the centre's, with |
required |
y1
|
float
|
The y1 value (the centre's, with |
required |
x2
|
float
|
The x2 value. |
required |
y2
|
float
|
The y2 value. |
required |
from_center
|
bool
|
|
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_chamfer
async
¶
add_sketch_chamfer(corners: list[list[float]], distance: float, distance2: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]
Bevel sketch corners picked by point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corners
|
list[list[float]]
|
|
required |
distance
|
float
|
Distance along the first side, mm. |
required |
distance2
|
float | None
|
Distance along the second side, mm. |
None
|
angle
|
float | None
|
Angle from the first side, degrees. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_circle
async
¶
add_sketch_circle(center_x: float, center_y: float, radius: float, construction: bool = False) -> AdapterResult[str]
Alias for add_circle used by some tool flows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_x
|
float
|
The center x value. |
required |
center_y
|
float
|
The center y value. |
required |
radius
|
float
|
The radius value. |
required |
construction
|
bool
|
The construction value. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_constraint
async
¶
add_sketch_constraint(entity1: str, entity2: str | None, relation_type: str, entity3: str | None = None) -> AdapterResult[str]
Apply a geometric constraint between sketch entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity1
|
str
|
The entity1 value. |
required |
entity2
|
str | None
|
The entity2 value. |
required |
relation_type
|
str
|
The relation type value. |
required |
entity3
|
str | None
|
Third entity ID — only used by the
|
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_dimension
async
¶
add_sketch_dimension(entity1: str, entity2: str | None, dimension_type: str, value: float) -> AdapterResult[str]
Add a sketch dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity1
|
str
|
The entity1 value. |
required |
entity2
|
str | None
|
The entity2 value. |
required |
dimension_type
|
str
|
The dimension type value. |
required |
value
|
float
|
The value value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_fillet
async
¶
Round sketch corners picked by point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corners
|
list[list[float]]
|
|
required |
radius
|
float
|
Fillet radius in mm. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
add_sketch_text
async
¶
add_sketch_text(text: str, x: float = 0.0, y: float = 0.0, height: float = 3.5, center_at: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Add text to the current sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text; |
required |
x
|
float
|
Start x in mm (sketch coordinates). |
0.0
|
y
|
float
|
Start y in mm (the baseline). |
0.0
|
height
|
float
|
Letter height in mm. |
3.5
|
center_at
|
list[float] | None
|
A model point [x, y, z] in mm for the text's middle. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
add_slot
async
¶
add_slot(kind: str, width: float, start: list[float], end: list[float], center: list[float] | None = None) -> AdapterResult[str]
Draw a straight or arc slot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
required |
width
|
float
|
Slot width, mm. |
required |
start
|
list[float]
|
Straight: first arc centre; arc: start on the arc. |
required |
end
|
list[float]
|
Straight: second arc centre; arc: end on the arc. |
required |
center
|
list[float] | None
|
Arc slot: the arc's centre. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The slot's id. |
Source code in src/solidworks_mcp/adapters/base.py
add_spline
async
¶
Add a spline through the provided points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
list[dict[str, float]]
|
The points value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
arrange_dimensions
async
¶
Move drawing dimensions so none overlaps, then verify.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
auto_center_marks
async
¶
auto_center_marks(view_name: str, mark_holes: bool = True, mark_fillets: bool = False, mark_slots: bool = True) -> AdapterResult[dict[str, Any]]
Auto-insert centre marks on circular features in a drawing view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_name
|
str
|
Name of a view on the active drawing. |
required |
mark_holes
|
bool
|
Mark holes / bores. |
True
|
mark_fillets
|
bool
|
Mark fillets. |
False
|
mark_slots
|
bool
|
Mark slots. |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The view and before/after centre-mark |
AdapterResult[dict[str, Any]]
|
counts, or error. |
Source code in src/solidworks_mcp/adapters/base.py
auto_dimension_view
async
¶
Auto-dimension one drawing view.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
check_interference
async
¶
Check the active assembly for interfering components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Any
|
Optional settings; |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Interference details, or error. |
Source code in src/solidworks_mcp/adapters/base.py
check_sketch_fully_defined
async
¶
Check whether a sketch is fully defined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch_name
|
str | None
|
Optional sketch name to inspect. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Definition status payload. |
Source code in src/solidworks_mcp/adapters/base.py
close_model
abstractmethod
async
¶
Close the current model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save
|
bool
|
The save value. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
connect
abstractmethod
async
¶
create_assembly
abstractmethod
async
¶
create_assembly(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Create a new assembly document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_axis
async
¶
Create a reference axis along a principal direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
"x", "y" or "z" (case-insensitive, leading ± stripped). |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The plane pair used and feature counts, or error. |
Source code in src/solidworks_mcp/adapters/base.py
create_base_flange
async
¶
create_base_flange(thickness: float, bend_radius: float, k_factor: float = 0.5, depth: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
A sheet-metal base flange from a sketch.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
create_configuration
async
¶
create_configuration(name: str, parent: str | None = None, description: str = '', activate: bool = False) -> AdapterResult[dict[str, Any]]
Add a configuration to the active model.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_cut
async
¶
Create a cut feature from an existing sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch_name
|
str
|
The sketch name value. |
required |
depth
|
float
|
The depth value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_cut_extrude
async
¶
Create a cut-extrude feature from the active sketch.
Cuts material from the current solid body using the active sketch profile. Equivalent to SolidWorks Insert > Cut > Extrude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
ExtrusionParameters
|
Depth and direction parameters. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AdapterResult |
AdapterResult[Any]
|
Feature result or error. |
Source code in src/solidworks_mcp/adapters/base.py
create_detail_view
async
¶
create_detail_view(view: str, center: list[float], radius: float, position: list[float], scale: str = '2:1', label: str | None = None) -> AdapterResult[dict[str, Any]]
Add a detail view of a circle in a drawing view.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_drawing
abstractmethod
async
¶
create_drawing(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Create a new drawing document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_drawing_view
async
¶
Place a view of a model on the active drawing sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path, orientation, position in millimetres and optional view scale. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The new view's details, or error. |
Source code in src/solidworks_mcp/adapters/base.py
create_exploded_view
async
¶
Explode the active assembly, automatically or step by step, and show it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
steps
|
list[dict[str, Any]] | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_extrusion
abstractmethod
async
¶
Create an extrusion feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
ExtrusionParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_hole
async
¶
create_hole(face_point: list[float], hole_type: str, standard: str, size: str, end_condition: str = 'through_all', depth: float | None = None, positions: list[list[float]] | None = None, fastener: str | None = None) -> AdapterResult[dict[str, Any]]
Add a Hole Wizard hole at a point on a flat face.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_loft
abstractmethod
async
¶
Create a loft feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
LoftParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_part
abstractmethod
async
¶
create_part(name: str | None = None, units: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]
Create a new part document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name value. Defaults to None. |
None
|
units
|
str | None
|
The units value. Defaults to None. |
None
|
template
|
str | None
|
Template file path. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_reference_plane
async
¶
create_reference_plane(reference: str, offset: float = 0.0, angle: float = 0.0, flip: bool = False, axis: str | None = None, face_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]
Create a reference plane offset from, angled to, or on a plane or face.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
Name of the reference plane. |
required |
offset
|
float
|
Offset distance in millimetres. Defaults to 0.0. |
0.0
|
angle
|
float
|
Angle in degrees about |
0.0
|
flip
|
bool
|
Reverse the offset or angle direction. Defaults to False. |
False
|
axis
|
str | None
|
Named axis to rotate about; needed with |
None
|
face_point
|
list[float] | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The new plane's name and parameters, or error. |
Source code in src/solidworks_mcp/adapters/base.py
create_reference_point
async
¶
create_reference_point(mode: str, x: float, y: float, z: float, distance: float | None = None, percent: float | None = None) -> AdapterResult[dict[str, Any]]
Create a reference point on the active part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
"along_curve" or "face_center". |
required |
x
|
float
|
X of a point on the target edge/face, in millimetres. |
required |
y
|
float
|
Y of a point on the target edge/face, in millimetres. |
required |
z
|
float
|
Z of a point on the target edge/face, in millimetres. |
required |
distance
|
float | None
|
For "along_curve", offset from the edge start in millimetres. |
None
|
percent
|
float | None
|
For "along_curve", position as 0-100 of the edge length. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The mode and feature counts, or error. |
Source code in src/solidworks_mcp/adapters/base.py
create_revolve
abstractmethod
async
¶
Create a revolve feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
RevolveParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_rib
async
¶
create_rib(sketch: str, thickness: float, both_sides: bool = True, flip_material: bool = False, normal_to_sketch: bool = False) -> AdapterResult[dict[str, Any]]
Add a rib from an open sketch.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_section_view
async
¶
create_section_view(view: str, line_start: list[float], line_end: list[float], position: list[float], label: str | None = None) -> AdapterResult[dict[str, Any]]
Add a section view cut along a line across a drawing view.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_shell
async
¶
create_shell(thickness: float, faces: list[list[float]], outward: bool = False) -> AdapterResult[dict[str, Any]]
Hollow the body to a wall thickness.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
create_sketch
abstractmethod
async
¶
create_sketch(plane: str | None, face_point: tuple[float, float, float] | None = None) -> AdapterResult[str]
Create a new sketch on a plane, or on the flat face at a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plane
|
str | None
|
The plane's name; None when |
required |
face_point
|
tuple[float, float, float] | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_sketched_bend
async
¶
create_sketched_bend(angle: float = 90.0, bend_radius: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]
Bend the sheet along a sketched line.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
create_standard_drawing
async
¶
create_standard_drawing(model_path: str, output_dir: str | None = None, title: str | None = None, subtitle: str | None = None, drawing_number: str | None = None, author: str = '', revision: str = 'A', company: str = '', drawn_date: str | None = None, notes: list[str] | None = None, include_isometric: bool = True, write_model_properties: bool = True, title_block_text_height_mm: float | None = None, include_bom: bool = False) -> AdapterResult[dict[str, Any]]
Create a complete standard A3 drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
create_sweep
abstractmethod
async
¶
Create a sweep feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
SweepParameters
|
The params value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksFeature]
|
AdapterResult[SolidWorksFeature]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
create_technical_drawing
async
¶
Lay out the standard views of a model on the active sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
Tool payload carrying the model path and the projection angle. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The view names created, or error. |
Source code in src/solidworks_mcp/adapters/base.py
delete_configuration
async
¶
Delete a configuration.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
delete_equation
async
¶
Delete the equation for name.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
delete_feature
async
¶
Delete a named feature or sketch from the active model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Feature or sketch name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: What was deleted, or error. |
Source code in src/solidworks_mcp/adapters/base.py
disconnect
abstractmethod
async
¶
drawing_report
async
¶
Read what check_drawing judges on the active drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
exit_sketch
abstractmethod
async
¶
Exit sketch editing mode.
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
export_file
abstractmethod
async
¶
Export the current model to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the target file. |
required |
format_type
|
str
|
The format type value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[None]
|
AdapterResult[None]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
export_flat_pattern
async
¶
Export the active sheet-metal part's flat pattern.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
export_image
abstractmethod
async
¶
Export a viewport screenshot (PNG/JPG) of the current model.
Payload keys: file_path (str): Absolute output path. width (int): Image width in pixels. height (int): Image height in pixels. view_orientation (str): One of "isometric", "front", "top", "right", "back", "bottom", "current".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
dict
|
The payload value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict]
|
AdapterResult[dict]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
get_application_info
async
¶
Describe the connected SolidWorks without changing anything.
Only file names leave the adapter, never full paths, so the result
can be pasted into a public report. A value that cannot be read is
None, never guessed.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/base.py
get_custom_properties
async
¶
Read the custom properties of the active document.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
get_dimension
abstractmethod
async
¶
Get the value of a dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
get_mass_properties
abstractmethod
async
¶
Get mass properties of the current model.
Returns:
| Type | Description |
|---|---|
AdapterResult[MassProperties]
|
AdapterResult[MassProperties]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
get_material
async
¶
get_material(configuration: str | None = None, material: str | None = None, database: str | None = None) -> AdapterResult[dict[str, Any]]
Read the active part's material and its properties, or a library material's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration
|
str | None
|
Configuration name; the active one when omitted. |
None
|
material
|
str | None
|
A library material to read instead of the part's. |
None
|
database
|
str | None
|
The library to look in first for |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
get_metrics ¶
Get adapter metrics.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the resulting values. |
get_model_geometry_summary
async
¶
Summarise the active part or assembly without changing it.
Must not rebuild the model, modify it, or clear the selection, so
callers can read it around a feature call. Values the adapter cannot
determine are None, never guessed.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/base.py
get_model_info
abstractmethod
async
¶
Get metadata for the active model.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
get_selected_entities
async
¶
Report the faces/edges/vertices currently selected in the live UI.
Lets an agent see exactly what the user has clicked on in SolidWorks (e.g. "chamfer THIS face") instead of inferring it from a screenshot.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: One descriptor per selected |
AdapterResult[list[dict[str, Any]]]
|
entity. See the PyWin32 adapter's implementation for the field |
AdapterResult[list[dict[str, Any]]]
|
set (varies by entity type). |
Source code in src/solidworks_mcp/adapters/base.py
get_template_folders
async
¶
SolidWorks' document template folders and the active document's template extension.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
health_check
abstractmethod
async
¶
Get adapter health status.
Returns:
| Name | Type | Description |
|---|---|---|
AdapterHealth |
AdapterHealth
|
The result produced by the operation. |
insert_bom_table
async
¶
insert_bom_table(view_name: str, template_path: str | None = None, bom_type: str = 'top_level_only', x_mm: float | None = None, y_mm: float | None = None) -> AdapterResult[dict[str, Any]]
Insert a BOM table anchored to an assembly drawing view.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
insert_component
async
¶
insert_component(file_path: str, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> AdapterResult[dict[str, Any]]
Insert a part or sub-assembly into the active assembly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Absolute path to the |
required |
x
|
float
|
X position in millimetres. Defaults to 0.0. |
0.0
|
y
|
float
|
Y position in millimetres. Defaults to 0.0. |
0.0
|
z
|
float
|
Z position in millimetres. Defaults to 0.0. |
0.0
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Component name and counts, or error. |
Source code in src/solidworks_mcp/adapters/base.py
insert_model_dimensions
async
¶
insert_model_dimensions(view_name: str | None = None, include_hole_wizard: bool = True) -> AdapterResult[dict[str, Any]]
Bring model dimensions into drawing views.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
is_connected
abstractmethod
¶
Check if connected to SolidWorks.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if connected, otherwise False. |
list_available_materials
async
¶
List materials from the configured material libraries.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, str]]]
|
AdapterResult[list[dict[str, str]]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
list_components
async
¶
List the top-level components of the active assembly.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: Component instance names, or error. |
Source code in src/solidworks_mcp/adapters/base.py
list_configurations
abstractmethod
async
¶
List configuration names for the active model.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: The result produced by the operation. |
list_drawing_views
async
¶
List the views on the active drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[str]]
|
AdapterResult[list[str]]: View names, or error. |
Source code in src/solidworks_mcp/adapters/base.py
list_equations
async
¶
List the active model's equations and global variables.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
list_features
abstractmethod
async
¶
list_features(include_suppressed: bool = False, max_assembly_depth: int = 2) -> AdapterResult[list[dict[str, Any]]]
List model features from the feature tree.
For a Part document, returns that document's own feature list,
unchanged from prior behavior. For an Assembly document, returns a
single flat list containing the assembly's own top-level features
plus every resolved component's features, recursing into
sub-assemblies up to max_assembly_depth. Every descriptor gains
component, component_path, and component_parent keys:
None for a document's own features (Part features, or an Assembly's
top-level features), or the owning component's name/path for a
component-derived feature. component_parent is the immediate parent
component name when the component is nested inside a sub-assembly,
otherwise None. A component that cannot be resolved (suppressed,
lightweight-and-unloaded, missing file) is represented by one descriptor
with type: "UnresolvedComponent" instead of being silently dropped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_suppressed
|
bool
|
The include suppressed value. Defaults to False. Applied independently to the assembly's own features and to each component's features. |
False
|
max_assembly_depth
|
int
|
How many levels of sub-assembly to recurse into. Defaults to 2. Ignored for Part documents. A component beyond the configured depth still appears in the result as a single descriptor (name + path), not expanded. |
2
|
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
list_hole_sizes
async
¶
list_hole_sizes(standard: str, hole_type: str, fastener: str | None = None, size: str | None = None) -> AdapterResult[dict[str, Any]]
List the Hole Wizard hole types and sizes of a standard.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
list_model_dimensions
async
¶
List every dimension in the active part or assembly.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
list_open_documents
async
¶
Enumerate every document currently open in SolidWorks.
Returns:
| Type | Description |
|---|---|
AdapterResult[list[dict[str, Any]]]
|
AdapterResult[list[dict[str, Any]]]: One entry per open document |
AdapterResult[list[dict[str, Any]]]
|
( |
Source code in src/solidworks_mcp/adapters/base.py
measure_entities
async
¶
Measure one or two selected entities.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
mirror_components
async
¶
Mirror components about a plane, as instances of the same parts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[str]
|
Instance names. |
required |
plane
|
str
|
The plane's name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
mirror_feature
async
¶
mirror_feature(features: list[str], mirror_plane: str, merge: bool = True, mirror_bodies: bool = True) -> AdapterResult[dict[str, Any]]
Mirror solid bodies or features about a plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
list[str]
|
Body or feature names to mirror. |
required |
mirror_plane
|
str
|
Plane name to mirror about. |
required |
merge
|
bool
|
Merge the mirrored result with the original. Defaults to True. |
True
|
mirror_bodies
|
bool
|
Mirror whole bodies rather than features. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The mirror feature's name, inputs and volume |
AdapterResult[dict[str, Any]]
|
before/after, or error. |
Source code in src/solidworks_mcp/adapters/base.py
open_model
abstractmethod
async
¶
Open a SolidWorks model (part, assembly, or drawing).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the target file. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[SolidWorksModel]
|
AdapterResult[SolidWorksModel]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
pack_and_go_assembly
async
¶
Copy an assembly and every file it uses into one folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_path
|
str
|
The |
required |
target_dir
|
str
|
The folder to copy into. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
pattern_circular
async
¶
pattern_circular(features: list[str], axis: str, count: int, angle: float = 360.0, equal_spacing: bool = True) -> AdapterResult[dict[str, Any]]
Pattern features around an axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
list[str]
|
Names of the features to pattern. |
required |
axis
|
str
|
Name of the axis to rotate about. |
required |
count
|
int
|
Total number of instances including the original. |
required |
angle
|
float
|
Total angle in degrees to spread them over. Defaults to 360.0. |
360.0
|
equal_spacing
|
bool
|
Space instances evenly across |
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: What was patterned and the volume |
AdapterResult[dict[str, Any]]
|
before/after, or error. |
Source code in src/solidworks_mcp/adapters/base.py
pattern_components
async
¶
pattern_components(components: list[str], axis: str, count: int, kind: str = 'linear', spacing: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]
Repeat components along or around a reference axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[str]
|
The seed components' instance names. |
required |
axis
|
str
|
A reference axis's name. |
required |
count
|
int
|
Instances, the seeds included. |
required |
kind
|
str
|
|
'linear'
|
spacing
|
float | None
|
Linear spacing, mm. |
None
|
angle
|
float | None
|
Circular angle, degrees. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
pattern_linear
async
¶
pattern_linear(features: list[str], direction: list[float] | str, count: int, spacing: float, direction2: list[float] | str | None = None, count2: int = 1, spacing2: float = 0.0, reverse: bool = False, reverse2: bool = False) -> AdapterResult[dict[str, Any]]
Repeat features along one or two directions.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
rebuild_model
async
¶
Force a rebuild and report per-feature rebuild errors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
top_level_only
|
bool
|
Rebuild only the top level of an assembly. Defaults to False (full rebuild). |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
ERROR (still carrying |
AdapterResult[dict[str, Any]]
|
remains. |
Source code in src/solidworks_mcp/adapters/base.py
rename_feature
async
¶
Rename an existing feature on the feature tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
old_name
|
str
|
Current feature name. |
required |
new_name
|
str
|
New feature name. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The old and new names, or error. |
Source code in src/solidworks_mcp/adapters/base.py
replace_component
async
¶
replace_component(component: str, file_path: str, all_instances: bool = False) -> AdapterResult[dict[str, Any]]
Swap a component for another part or assembly file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
The instance name. |
required |
file_path
|
str
|
The part or assembly to put in its place. |
required |
all_instances
|
bool
|
Replace every instance of the same file. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
reset_circuit_breakers
async
¶
Re-open operations a circuit breaker paused.
An adapter without a circuit breaker has nothing paused; the breaker and the connection pool override this.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operation
|
str | None
|
The operation to reset; |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, list[str]]]
|
AdapterResult[dict[str, list[str]]]: |
Source code in src/solidworks_mcp/adapters/base.py
save_as_template
async
¶
Save a copy of the active document as a template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The template's full path, with the document's template extension (.prtdot, .asmdot or .drwdot). |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
save_body_as_part
async
¶
Extract one solid body from the active multibody part to a new file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body_name
|
str
|
Name of a solid body in the active part. |
required |
file_path
|
str
|
Absolute path for the new |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The body, the written path, and the |
AdapterResult[dict[str, Any]]
|
solid-body names found, or error. |
Source code in src/solidworks_mcp/adapters/base.py
save_copy
async
¶
Write a copy of the active document and keep the original open.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Where to write the copy. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
save_file
async
¶
Save the active model to the existing path or the provided path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | None
|
Path to the target file. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[Any]
|
AdapterResult[Any]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
select_face_edges
async
¶
select_face_edges(point: list[float] | None = None, side: str | None = None, plane: str | None = None, edge_type: str = 'all', append: bool = False) -> AdapterResult[dict[str, Any]]
Multi-select every edge bounding one face of the active part.
Exactly one of point/side/plane identifies the face.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
list[float] | None
|
|
None
|
side
|
str | None
|
|
None
|
plane
|
str | None
|
Reference plane name; the body face(s) lying on it. |
None
|
edge_type
|
str
|
|
'all'
|
append
|
bool
|
Add to the current selection. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
(one descriptor per selected edge) and |
Source code in src/solidworks_mcp/adapters/base.py
select_feature
async
¶
Select a named feature, sketch, plane or component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_name
|
str
|
The feature name, optionally |
required |
append
|
bool
|
Add to the current selection instead of replacing it. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: On success |
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
|
AdapterResult[dict[str, Any]]
|
SUCCESS with |
Source code in src/solidworks_mcp/adapters/base.py
set_component_appearance
async
¶
set_component_appearance(component: str, visible: bool | None = None, transparent: bool | None = None) -> AdapterResult[dict[str, Any]]
Hide or show a component, and make it transparent or opaque.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
The instance name. |
required |
visible
|
bool | None
|
Show ( |
None
|
transparent
|
bool | None
|
Transparent or opaque. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
set_component_state
async
¶
set_component_state(component: str, fixed: bool | None = None, flexible: bool | None = None) -> AdapterResult[dict[str, Any]]
Fix or float a component, and make a sub-assembly rigid or flexible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
str
|
Instance name, as |
required |
fixed
|
bool | None
|
True fixes it, False floats it. |
None
|
flexible
|
bool | None
|
True flexible, False rigid. |
None
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The state before and after, or error. |
Source code in src/solidworks_mcp/adapters/base.py
set_construction_geometry
async
¶
set_construction_geometry(entities: list[str], construction: bool = True) -> AdapterResult[dict[str, Any]]
Make sketch entities construction geometry, or normal again.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
Sketch entity ids. |
required |
construction
|
bool
|
|
True
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/base.py
set_custom_property
async
¶
set_custom_property(name: str, value: str, configuration: str | None = None) -> AdapterResult[dict[str, Any]]
Create or overwrite one custom property.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
set_dimension
abstractmethod
async
¶
set_dimension(name: str, value: float, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]
Set the value of a dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
value
|
float
|
The value value. |
required |
configurations
|
str | list[str]
|
"this", "all" or names. |
'this'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
set_equation
async
¶
set_equation(name: str, expression: str, configurations: str | list[str] = 'all') -> AdapterResult[dict[str, Any]]
Add an equation, or change the one name has.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A global variable or a dimension ( |
required |
expression
|
str
|
The right-hand side. |
required |
configurations
|
str | list[str]
|
"all", "this" or names. |
'all'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
set_exploded_view
async
¶
Show the assembly's exploded view, or collapse it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exploded
|
bool
|
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
set_flat_pattern
async
¶
Flatten the sheet-metal part, or fold it back.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
set_material
async
¶
set_material(material_name: str, database: str | None = None, configuration: str | None = None) -> AdapterResult[dict[str, Any]]
Assign a material to the active part.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
set_sheet_scale
async
¶
Set the active drawing sheet's scale.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Error unless the adapter implements it. |
Source code in src/solidworks_mcp/adapters/base.py
set_sketch_text
async
¶
Rewrite the text in a sketch, with the sketch open, then rebuild.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch_name
|
str
|
The sketch, e.g. |
required |
text
|
str
|
The new text. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
Source code in src/solidworks_mcp/adapters/base.py
set_units
async
¶
Set the active document's linear unit system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit_system
|
str
|
One of |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: What was applied, or error. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_circular_pattern
async
¶
Create a circular pattern of sketch entities around the sketch origin.
The rotation axis is always the sketch origin — SW's
CreateCircularSketchStepAndRepeat has no pattern-centre
parameter and derives the axis from the seed's geometry. Place
the seed entity at the desired radius from the origin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
The entities value. |
required |
angle
|
float
|
The angle value. |
required |
count
|
int
|
The count value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_convert_entities
async
¶
sketch_convert_entities(edge_points: list[list[float]] | None = None, face_point: list[float] | None = None, construction: bool = False) -> AdapterResult[dict[str, Any]]
Copy model edges or a face outline into the open sketch.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_extend
async
¶
Extend a sketch entity from its end nearest a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
list[float]
|
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/base.py
sketch_linear_pattern
async
¶
sketch_linear_pattern(entities: list[str], direction_x: float, direction_y: float, spacing: float, count: int) -> AdapterResult[str]
Create a linear pattern of sketch entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
The entities value. |
required |
direction_x
|
float
|
The direction x value. |
required |
direction_y
|
float
|
The direction y value. |
required |
spacing
|
float
|
The spacing value. |
required |
count
|
int
|
The count value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_mirror
async
¶
Mirror sketch entities about a mirror line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
The entities value. |
required |
mirror_line
|
str
|
The mirror line value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_offset
async
¶
sketch_offset(entities: list[str], offset_distance: float, reverse_direction: bool) -> AdapterResult[str]
Offset sketch entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[str]
|
The entities value. |
required |
offset_distance
|
float
|
The offset distance value. |
required |
reverse_direction
|
bool
|
The reverse direction value. |
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
Source code in src/solidworks_mcp/adapters/base.py
sketch_trim
async
¶
Trim the piece of a sketch entity nearest a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
list[float]
|
|
required |
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: |
AdapterResult[dict[str, Any]]
|
|
Source code in src/solidworks_mcp/adapters/base.py
suppress_feature
async
¶
suppress_feature(name: str, suppress: bool = True, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]
Suppress or unsuppress a named feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Feature name. |
required |
suppress
|
bool
|
True to suppress, False to unsuppress. |
True
|
configurations
|
str | list[str]
|
"this", "all" or names. |
'this'
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: The resulting state, or error. |
Source code in src/solidworks_mcp/adapters/base.py
undo
async
¶
Undo the last operations in the active model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of steps to undo. |
1
|
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Whether the tree changed, or error. |
Source code in src/solidworks_mcp/adapters/base.py
update_metrics ¶
Update adapter metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operation_time
|
float
|
The operation time value. |
required |
success
|
bool
|
The success value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None. |
Source code in src/solidworks_mcp/adapters/base.py
update_sheet_format
async
¶
update_sheet_format(sheet_format: str, paper_size: str | None = None) -> AdapterResult[dict[str, Any]]
Change the active sheet's format and paper size, keeping its views.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
update_title_block
async
¶
Write title-block fields on the active drawing.
Returns:
| Type | Description |
|---|---|
AdapterResult[dict[str, Any]]
|
AdapterResult[dict[str, Any]]: Not implemented by this adapter. |
Source code in src/solidworks_mcp/adapters/base.py
SolidWorksFeature ¶
Bases: BaseModel
SolidWorks feature information.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
The id value. |
name |
str
|
The name value. |
parameters |
dict[str, Any] | None
|
The parameters value. |
parent |
str | None
|
The parent value. |
properties |
dict[str, Any] | None
|
The properties value. |
type |
str
|
The type value. |
SolidWorksModel ¶
Bases: BaseModel
SolidWorks model information.
Attributes:
| Name | Type | Description |
|---|---|---|
configuration |
str | None
|
The configuration value. |
is_active |
bool
|
The is active value. |
name |
str
|
The name value. |
path |
str
|
The path value. |
properties |
dict[str, Any] | None
|
The properties value. |
type |
str
|
The type value. |
SolidWorksOperationError ¶
Bases: SolidWorksMCPError
Exception raised when SolidWorks operation fails.
SweepParameters ¶
Bases: BaseModel
Parameters for sweep operations.
Attributes:
| Name | Type | Description |
|---|---|---|
merge_result |
bool
|
The merge result value. |
path |
str
|
The path value. |
twist_along_path |
bool
|
The twist along path value. |
twist_angle |
float
|
The twist angle value. |
_BoolCallable ¶
Compatibility shim that behaves as both bool and callable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
getter
|
Callable[[], bool]
|
The getter value. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
_getter |
Any
|
The getter value. |
Initialize the bool callable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
getter
|
Callable[[], bool]
|
The getter value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None. |
Source code in src/solidworks_mcp/adapters/mock_adapter.py
Functions:¶
_normalise_mock_unit_system ¶
Map a user-supplied unit token onto a canonical key of _SW_UNIT_SYSTEMS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit_system
|
str
|
e.g. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: |
str | None
|
the token is not recognised. |
Source code in src/solidworks_mcp/adapters/solidworks/io.py
describe ¶
describe(library: HoleLibrary, standard: str, hole_type: str, fastener: str | None = None, size: str | None = None) -> dict[str, Any]
What list_hole_sizes returns.
No size: the hole types of the kind (only fastener's when given),
each with its enabled sizes. With size: that size's dimensions, in
the hole type fastener names or the default one for the kind.
Raises:
| Type | Description |
|---|---|
HoleSizeError
|
For an unknown hole type or size. |
Source code in src/solidworks_mcp/adapters/solidworks/hole_library.py
gtol_problem ¶
gtol_problem(characteristic: str, tolerance: float, material_condition: str, datums: list[str] | None) -> str | None
Why a feature control frame's inputs are invalid, or None when valid.
Shared by the real and mock adapters so both refuse the same inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
characteristic
|
str
|
The GD&T characteristic name. |
required |
tolerance
|
float
|
The tolerance value. |
required |
material_condition
|
str
|
|
required |
datums
|
list[str] | None
|
Datum letters, primary first. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The problem, in words. |
Source code in src/solidworks_mcp/adapters/solidworks/drawing_standard.py
sample_library ¶
A few real ISO and ANSI inch hole types and sizes (SolidWorks 2026).
The mock adapter's library: the default hole types of each kind, with their dimensions copied from the installed library.
Source code in src/solidworks_mcp/adapters/solidworks/hole_library.py
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | |