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.
tests/integration/test_progress_up_to_date.py fails when any of them is
out of date.
Attributes¶
SUPPORT_LEVELS
module-attribute
¶
SUPPORT_LEVELS: dict[str, Support] = {'analyze_geometry': _PLANNED, 'calculate_mass_properties': _STABLE, 'check_interference': _STABLE, 'get_mass_properties': _STABLE, 'get_material_properties': _PLANNED, 'verify_model': _STABLE, 'automation_start_macro_recording': _PLANNED, 'automation_stop_macro_recording': _PLANNED, 'batch_process_files': _PLANNED, 'create_template': _PLANNED, 'execute_workflow': _PLANNED, 'generate_vba_code': _STABLE, 'manage_design_table': _PLANNED, 'optimize_performance': _PLANNED, 'discover_solidworks_docs': _STABLE, 'find_related_api_members': _STABLE, 'lookup_api_interface': _STABLE, 'lookup_api_method': _STABLE, 'search_solidworks_api_help': _STABLE, 'add_annotation': _PLANNED, 'add_dimension': _PLANNED, 'add_drawing_view': _STABLE, 'add_note': _STABLE, 'auto_center_marks': _STABLE, 'auto_dimension_view': _PLANNED, 'check_drawing_standards': _PLANNED, 'create_detail_view': _PLANNED, 'create_drawing_view': _STABLE, 'create_section_view': _PLANNED, 'create_technical_drawing': _STABLE, 'list_drawing_views': _STABLE, 'update_sheet_format': _PLANNED, 'update_title_block': _PLANNED, 'analyze_drawing_annotations': _PLANNED, 'analyze_drawing_comprehensive': _PLANNED, 'analyze_drawing_dimensions': _PLANNED, 'analyze_drawing_views': _PLANNED, 'check_drawing_compliance': _PLANNED, 'compare_drawing_versions': _STABLE, 'generate_drawing_report': _PLANNED, 'validate_drawing_completeness': _PLANNED, '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, 'batch_export': _PLANNED, 'export_dwg': _STABLE, 'export_iges': _STABLE, 'export_image': _STABLE, 'export_pdf': _STABLE, 'export_step': _STABLE, 'export_stl': _STABLE, 'activate_document': _STABLE, 'batch_file_operations': _PLANNED, 'classify_feature_tree': _STABLE, 'convert_file_format': _PLANNED, 'get_file_properties': _STABLE, 'get_model_info': _STABLE, 'get_selected_entities': _STABLE, 'list_configurations': _STABLE, 'list_features': _STABLE, 'list_open_documents': _STABLE, 'load_assembly': _STABLE, 'load_part': _STABLE, 'manage_file_properties': _PLANNED, 'pack_and_go_assembly': _STABLE, 'save_as': _STABLE, 'save_assembly': _STABLE, 'save_body_as_part': _STABLE, 'save_file': _STABLE, 'save_part': _STABLE, 'analyze_macro': _PLANNED, 'batch_execute_macros': _PLANNED, 'create_macro_library': _PLANNED, 'execute_macro': _STABLE, 'optimize_macro': _PLANNED, 'start_macro_recording': _PLANNED, 'stop_macro_recording': _PLANNED, '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, '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_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_tutorial_simple_hole': _STABLE, 'tutorial_simple_hole': _PLANNED, 'apply_template': _PLANNED, 'batch_apply_template': _PLANNED, 'compare_templates': _STABLE, 'extract_template': _PLANNED, 'list_template_library': _PLANNED, 'save_to_template_library': _PLANNED, '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: 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
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 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 | |
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_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
add_arc
async
¶
add_arc(center_x: float, center_y: float, start_x: float, start_y: float, end_x: float, end_y: float) -> 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 |
Returns:
| Type | Description |
|---|---|
AdapterResult[str]
|
AdapterResult[str]: The result produced by the operation. |
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_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_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) -> AdapterResult[str]
Mock adding an axis-aligned 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 |
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
3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 | |
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
¶
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 |
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
¶
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 |
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_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
2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 | |
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_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
2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 | |
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_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_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
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 | |
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
3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 | |
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
3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 | |
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
create_sketch
async
¶
Mock creating a sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plane
|
str
|
The plane value. |
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
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
4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 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 | |
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_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
2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 | |
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
¶
Mock reading the active part material.
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
478 479 480 481 482 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 | |
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_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
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 3531 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 | |
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
3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 | |
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
3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 | |
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
2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 | |
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
783 784 785 786 787 788 789 790 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 | |
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_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_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
¶
Mock setting a dimension value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name value. |
required |
value
|
float
|
The value 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
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_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_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
1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 | |
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
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 | |
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
suppress_feature
async
¶
Mock suppressing or unsuppressing a named feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Feature name. |
required |
suppress
|
bool
|
True to suppress, False to unsuppress. |
True
|
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 four support levels, most trusted first.
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.
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
95 96 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 | |
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_rows
async
¶
Every registered tool, sorted by name.
Returns:
| Type | Description |
|---|---|
list[ToolRow]
|
list[ToolRow]: One row per tool. |