solidworks_mcp.progress.generate¶
solidworks_mcp.progress.generate ¶
Regenerate the progress image, its data and the docs page's tables.
Run from the repository root after adding a tool, changing a level or calling new COM methods in an adapter::
python -m solidworks_mcp.progress.generate
It writes, under docs/assets/progress/:
progress.svg: the README image;progress.json: every tool's family, level and summary, and the coverage of each core interface;tables.html: the docs page's HTML tables, readable without scripts;tool-list-size.md: the size of the tool list per toolset and mode (:mod:.tool_list_size).
tests/integration/test_progress_up_to_date.py fails when any of them is
out of date.
Attributes¶
OUTPUTS
module-attribute
¶
SUPPORT_LEVELS
module-attribute
¶
SUPPORT_LEVELS: dict[str, Support] = {'calculate_mass_properties': _deprecated('get_mass_properties'), 'check_interference': _STABLE, 'get_mass_properties': _STABLE, 'verify_model': _STABLE, 'generate_vba_code': _STABLE, 'discover_solidworks_docs': _STABLE, 'find_related_api_members': _STABLE, 'lookup_api_interface': _STABLE, 'get_api_enum': _STABLE, 'lookup_api_method': _STABLE, 'search_solidworks_api_help': _STABLE, 'add_dimension': _STABLE, 'add_drawing_view': _deprecated('create_drawing_view'), 'add_note': _STABLE, 'auto_center_marks': _STABLE, 'auto_dimension_view': _STABLE, 'check_drawing': _STABLE, 'create_detail_view': _STABLE, 'create_drawing_view': _STABLE, 'create_section_view': _STABLE, 'create_technical_drawing': _STABLE, 'list_drawing_views': _STABLE, 'update_sheet_format': _STABLE, 'update_title_block': _STABLE, 'compare_drawing_versions': _STABLE, 'add_datum_tag': _STABLE, 'add_gtol': _STABLE, 'arrange_dimensions': _STABLE, 'generate_drawing_package': _STABLE, 'insert_bom_table': _STABLE, 'insert_model_dimensions': _STABLE, 'set_sheet_scale': _STABLE, 'export_flat_pattern': _STABLE, 'get_custom_properties': _STABLE, 'get_material': _STABLE, 'list_available_materials': _STABLE, 'list_model_dimensions': _STABLE, 'measure_entities': _STABLE, 'set_custom_property': _STABLE, 'set_material': _STABLE, 'export_dwg': _STABLE, 'export_iges': _STABLE, 'export_image': _STABLE, 'export_pdf': _STABLE, 'export_step': _STABLE, 'export_stl': _STABLE, 'activate_document': _STABLE, 'classify_feature_tree': _STABLE, 'get_file_properties': _deprecated('get_model_info'), 'get_model_info': _STABLE, 'get_selected_entities': _STABLE, 'list_configurations': _STABLE, 'create_configuration': _STABLE, 'activate_configuration': _STABLE, 'delete_configuration': _STABLE, 'create_exploded_view': _STABLE, 'set_exploded_view': _STABLE, 'pattern_components': _STABLE, 'mirror_components': _STABLE, 'replace_component': _STABLE, 'add_balloons': _STABLE, 'list_equations': _STABLE, 'set_equation': _STABLE, 'delete_equation': _STABLE, 'list_features': _STABLE, 'list_open_documents': _STABLE, 'load_assembly': _deprecated('open_model'), 'load_part': _deprecated('open_model'), 'pack_and_go_assembly': _STABLE, 'save_as': _STABLE, 'save_assembly': _deprecated('save_file'), 'save_body_as_part': _STABLE, 'save_file': _STABLE, 'save_as_template': _STABLE, 'save_part': _deprecated('save_file'), 'execute_macro': _STABLE, 'add_chamfer': _STABLE, 'add_fillet': _STABLE, 'add_mate': _STABLE, 'close_model': _STABLE, 'create_assembly': _STABLE, 'create_axis': _STABLE, 'create_cut_extrude': _STABLE, 'create_drawing': _STABLE, 'create_extrusion': _STABLE, 'create_loft': _STABLE, 'create_part': _STABLE, 'create_reference_plane': _STABLE, 'create_reference_point': _STABLE, 'create_revolve': _STABLE, 'create_sweep': _STABLE, 'delete_feature': _STABLE, 'get_dimension': _STABLE, 'insert_component': _STABLE, 'list_components': _STABLE, 'mirror_feature': _STABLE, 'open_model': _STABLE, 'pattern_circular': _STABLE, 'pattern_linear': _STABLE, 'create_shell': _STABLE, 'add_draft': _STABLE, 'create_rib': _STABLE, 'create_base_flange': _STABLE, 'add_edge_flange': _STABLE, 'create_sketched_bend': _STABLE, 'set_flat_pattern': _STABLE, 'create_hole': _STABLE, 'list_hole_sizes': _STABLE, 'add_cosmetic_thread': _STABLE, 'rebuild_model': _STABLE, 'rename_feature': _STABLE, 'select_face_edges': _STABLE, 'select_feature': _STABLE, 'set_component_state': _STABLE, 'set_dimension': _STABLE, 'set_units': _STABLE, 'suppress_feature': _STABLE, 'undo': _STABLE, 'reset_circuit_breaker': _STABLE, 'add_arc': _STABLE, 'add_centerline': _STABLE, 'add_circle': _STABLE, 'add_ellipse': _STABLE, 'add_sketch_text': _STABLE, 'set_sketch_text': _STABLE, 'add_sketch_fillet': _STABLE, 'add_sketch_chamfer': _STABLE, 'add_slot': _STABLE, 'sketch_trim': _STABLE, 'sketch_extend': _STABLE, 'set_construction_geometry': _STABLE, 'add_line': _STABLE, 'add_polygon': _STABLE, 'add_rectangle': _STABLE, 'add_sketch_constraint': _STABLE, 'add_sketch_dimension': _STABLE, 'add_spline': _STABLE, 'check_sketch_fully_defined': _STABLE, 'create_sketch': _STABLE, 'exit_sketch': _STABLE, 'sketch_circular_pattern': _STABLE, 'sketch_linear_pattern': _STABLE, 'sketch_mirror': _STABLE, 'sketch_offset': _STABLE, 'sketch_convert_entities': _STABLE, 'sketch_tutorial_simple_hole': _deprecated(None), 'compare_templates': _STABLE, 'generate_vba_assembly_insert': _STABLE, 'generate_vba_assembly_mates': _STABLE, 'generate_vba_batch_export': _STABLE, 'generate_vba_drawing_dimensions': _STABLE, 'generate_vba_drawing_views': _STABLE, 'generate_vba_extrusion': _STABLE, 'generate_vba_file_operations': _STABLE, 'generate_vba_macro_recorder': _STABLE, 'generate_vba_part_modeling': _STABLE, 'generate_vba_revolve': _STABLE}
_WRAP_OPEN
module-attribute
¶
Classes¶
ComCoverage
dataclass
¶
ComCoverage(interfaces: tuple[InterfaceCoverage, ...], api_covered: int, api_total: int, type_library: str)
Coverage of the core interfaces and of the whole API.
Attributes:
| Name | Type | Description |
|---|---|---|
interfaces |
tuple[InterfaceCoverage, ...]
|
One entry per core interface, in |
api_covered |
int
|
Distinct method names called, across the whole API. |
api_total |
int
|
Distinct method names in the whole API. |
type_library |
str
|
The snapshot's source, which carries its version. |
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
Snapshot
dataclass
¶
The type library's interface and method names.
Attributes:
| Name | Type | Description |
|---|---|---|
type_library |
str
|
Where it came from (the gen_py wrapper's name). |
interfaces |
Mapping[str, frozenset[str]]
|
Interface name to its method names. |
Methods:¶
from_json
classmethod
¶
Read a snapshot written by :meth:to_json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The JSON text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Snapshot |
Snapshot
|
The parsed snapshot. |
Source code in src/solidworks_mcp/progress/com_coverage.py
load
classmethod
¶
Read the committed snapshot file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The snapshot's path. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Snapshot |
Snapshot
|
The parsed snapshot. |
Source code in src/solidworks_mcp/progress/com_coverage.py
to_json ¶
The snapshot as committed: sorted, one interface per line.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
JSON text ending in a newline. |
Source code in src/solidworks_mcp/progress/com_coverage.py
SupportLevel ¶
Bases: StrEnum
The five support levels: four by trust, then the replaced tools.
ToolRow
dataclass
¶
One registered tool, as the progress page lists it.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The tool name. |
family |
str
|
Its family (the module that defines it). |
level |
SupportLevel
|
Its support level. |
reason |
str
|
Why it isn't stable (empty when it is). |
summary |
str
|
The first paragraph of its docstring. |
Functions:¶
adapter_sources ¶
The text of every Python file under the adapters package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adapters_dir
|
Path
|
|
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: One string per file, in path order. |
Source code in src/solidworks_mcp/progress/com_coverage.py
build ¶
Every generated file's content, from the code under root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
The repository root. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
dict[str, str]: File name (in |
Source code in src/solidworks_mcp/progress/generate.py
called_names ¶
Capitalised names the source uses as attributes or string literals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
Iterable[str]
|
The text of each source file. |
required |
Returns:
| Type | Description |
|---|---|
set[str]
|
set[str]: Candidate COM member names (not yet matched to the API). |
Source code in src/solidworks_mcp/progress/com_coverage.py
main ¶
Write the generated files under root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path | None
|
The repository root; the current directory when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
list[Path]: The files written. |
Source code in src/solidworks_mcp/progress/generate.py
measure ¶
Coverage of the core interfaces and the whole API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
Snapshot
|
The type library's names. |
required |
called
|
set[str]
|
Names found in the adapter source. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ComCoverage |
ComCoverage
|
The counts. |
Source code in src/solidworks_mcp/progress/com_coverage.py
progress_json ¶
The data behind the image and the page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
list[ToolRow]
|
Every tool. |
required |
coverage
|
ComCoverage
|
The COM coverage. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
JSON text ending in a newline. |
Source code in src/solidworks_mcp/progress/generate.py
register_tools
async
¶
Register all SolidWorks MCP tools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp
|
FastMCP
|
The mcp value. |
required |
adapter
|
Any
|
Adapter instance used for the operation. |
required |
config
|
Any
|
Configuration values for the operation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The computed numeric result. |
Source code in src/solidworks_mcp/tools/__init__.py
render ¶
The progress image.
Deprecated tools are left out of the headline count and the bar (each has a replacement in the bar already) and shown in the legend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
levels
|
Mapping[SupportLevel, int]
|
How many tools have each support level. |
required |
coverage
|
ComCoverage
|
COM coverage of the core interfaces and the whole API. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The SVG document. |
Source code in src/solidworks_mcp/progress/svg.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 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 | |
tables_html ¶
The page's two tables, as HTML the docs page includes.
Each tool row carries data-level and data-family for the filter
script, and its level as text as well as colour.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
list[ToolRow]
|
Every tool. |
required |
coverage
|
ComCoverage
|
The COM coverage. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The HTML. |
Source code in src/solidworks_mcp/progress/generate.py
tool_family ¶
The family tag of a tool: the name of the module that defines it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
Callable[..., Any]
|
The tool function. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The module's last dotted part, e.g. |
Source code in src/solidworks_mcp/tools/tool_boundary.py
tool_list_size ¶
The generated table's content.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The Markdown table. |
tool_rows
async
¶
Every registered tool, sorted by name.
Returns:
| Type | Description |
|---|---|
list[ToolRow]
|
list[ToolRow]: One row per tool. |