activate_configuration | file_management | stable | Make a configuration of the active model the active one, and rebuild. |
activate_document | file_management | stable | Make an already-open document the active one, so the next tools act on it. |
+activate_sheet | drawing_sheets | beta new: checked on SolidWorks by a scratch run, not yet by a live demo. | Make a sheet of the active drawing the active one, so new views and notes go on it. |
add_arc | sketching | stable | Draw a circular arc in the open sketch: from its centre, through three points, or tangent. |
add_balloons | drawing | stable | Number the parts in a drawing view with balloons, one per part. |
add_centerline | sketching | stable | Draw a centreline (construction line) in the open sketch, in mm. |
@@ -23,6 +24,7 @@
add_note | drawing | stable | Place a text note on the active drawing sheet at a position in millimetres. |
add_polygon | sketching | stable | Draw a regular polygon (e.g. a hexagon) in the open sketch from its centre, radius and number of sides. |
add_rectangle | sketching | stable | Draw a closed, axis-aligned rectangle in the open sketch from two opposite corners, in mm. |
+add_sheet | drawing_sheets | beta new: checked on SolidWorks by a scratch run, not yet by a live demo. | Add a sheet to the active drawing, with a format, paper size and scale, and make it the active sheet. |
add_sketch_chamfer | sketching | stable | Bevel corners of the open sketch, picking each corner by its point. |
add_sketch_constraint | sketching | stable | Add a geometric relation between sketch entities: horizontal, vertical, parallel, perpendicular, tangent, coincident, concentric, equal, symmetric, collinear or fix. |
add_sketch_dimension | sketching | stable | Add a driving dimension to sketch entities: linear, angular, radial, diameter or an ellipse axis. |
@@ -121,6 +123,7 @@
list_hole_sizes | modeling | stable | List the Hole Wizard's hole types and sizes for a standard, or one size's dimensions. |
list_model_dimensions | engineering_data | stable | List every dimension in the active part or assembly with its full name and value. |
list_open_documents | file_management | stable | List every document open in SolidWorks and say which one is active. |
+list_sheets | drawing_sheets | beta new: checked on SolidWorks by a scratch run, not yet by a live demo. | List the active drawing's sheets with each one's paper size, scale and projection, and which is active. |
list_thread_sizes | threads | beta new: checked on SolidWorks by a scratch run, not yet by a live demo. | List the standard thread sizes SolidWorks holds, metric or inch, with coarse or fine pitch, depth and runout. |
load_assembly | file_management | deprecated use `open_model`. | Open an assembly (.sldasm) from disk and make it the active document. |
load_part | file_management | deprecated use `open_model`. | Open a part (.sldprt) from disk and make it the active document. |
@@ -188,7 +191,7 @@
IModelDocExtension | 22 | 337 | 6.5%AddDimension, CreateMassProperty, CreateMeasure, CustomPropertyManager, DeleteSelection2, GetAnnotations, GetCoordinateSystemTransformByName, GetMassProperties, GetSectionProperties2, GetUserPreferenceInteger, GetUserPreferenceToggle, GetWhatsWrong, GetWhatsWrongCount, InsertBomTable4, IsExploded, RemoveMaterialProperty, SaveAs, SaveAs2, SaveAs3, SelectByID2, SetUserPreferenceInteger, SetUserPreferenceToggle |
IPartDoc | 16 | 167 | 9.6%CreateExplodedView, ExportToDWG2, FeatureByName, FeatureExtrusion2, FeatureExtrusion3, FeatureExtrusionThin2, FeatureRevolve2, FirstFeature, GetBodies2, GetExplodedViewNames, GetMaterialPropertyName2, GetPartBox, InsertCombineFeature, InsertMirrorFeature, SetMaterialPropertyName2, ShowExploded |
IAssemblyDoc | 19 | 198 | 9.6%AddComponent4, AddComponent5, AddMate5, AutoExplode, CompConfigProperties5, CreateExplodedView, FeatureByName, FixComponent, GetBox, GetComponentByName, GetComponentCount, GetComponents, GetExplodedViewNames, MirrorComponents3, ReplaceComponents2, SetComponentTransparent, ShowExploded, ShowExploded2, UnfixComponent |
-IDrawingDoc | 18 | 272 | 6.6%ActivateView, AutoBalloon5, AutoDimension, Create1stAngleViews2, Create3rdAngleViews2, CreateAutoBalloonOptions, CreateDetailViewAt4, CreateDrawViewFromModelView3, CreateSectionViewAt5, EditSheet, EditSketch, EditTemplate, FeatureByName, GetCurrentSheet, GetFirstView, GetViews, InsertModelAnnotations3, SetupSheet5 |
+IDrawingDoc | 22 | 272 | 8.1%ActivateSheet, ActivateView, AutoBalloon5, AutoDimension, Create1stAngleViews2, Create3rdAngleViews2, CreateAutoBalloonOptions, CreateDetailViewAt4, CreateDrawViewFromModelView3, CreateSectionViewAt5, EditSheet, EditSketch, EditTemplate, FeatureByName, GetCurrentSheet, GetFirstView, GetSheetNames, GetViews, InsertModelAnnotations3, NewSheet4, SetupSheet5, Sheet |
IFeatureManager | 37 | 268 | 13.8%CreateCustomBendAllowance, CreateDefinition, CreateFeature, CreateSaveBodyFeature, FeatureCircularPattern5, FeatureCut3, FeatureCut4, FeatureExtrusion2, FeatureExtrusion3, FeatureExtrusionThin2, FeatureFillet3, FeatureLinearPattern5, FeatureRevolve2, GetFeatureCount, GetFlatPatternFolder, HoleWizard5, InsertCenterOfMass, InsertCombineFeature, InsertCoordinateSystem, InsertCosmeticThread3, InsertCutSwept5, InsertDeleteBody2, InsertFeatureChamfer, InsertGlobalBoundingBox, InsertMirrorFeature, InsertMoveCopyBody2, InsertMultiFaceDraft, InsertProtrusionBlend2, InsertProtrusionSwept4, InsertRefPlane, InsertReferencePoint, InsertRib, InsertScale, InsertSheetMetalBaseFlange2, InsertSheetMetalEdgeFlange2, PostSplitBody2, PreSplitBody2 |
ISketchManager | 24 | 83 | 28.9%Create3PointArc, CreateArc, CreateCenterLine, CreateCenterRectangle, CreateChamfer, CreateCircleByRadius, CreateCircularSketchStepAndRepeat, CreateCornerRectangle, CreateEllipse, CreateFillet, CreateLine, CreateLinearSketchStepAndRepeat, CreatePoint, CreatePolygon, CreateSketchSlot, CreateSpline2, CreateTangentArc, Insert3DSketch, InsertSketch, SketchExtend, SketchOffset2, SketchTrim, SketchUseEdge, SketchUseEdge3 |
ISelectionMgr | 4 | 61 | 6.6%CreateSelectData, GetSelectedObject6, GetSelectedObjectCount2, GetSelectedObjectType3 |
diff --git a/docs/assets/progress/tool-list-size.md b/docs/assets/progress/tool-list-size.md
index b6b84053..11da9eea 100644
--- a/docs/assets/progress/tool-list-size.md
+++ b/docs/assets/progress/tool-list-size.md
@@ -1,11 +1,11 @@
| `SOLIDWORKS_MCP_TOOLSETS` | `SOLIDWORKS_MCP_TOOL_MODE` | Tools listed | Size | Tokens (estimate) | Of the full list |
| --- | --- | ---: | ---: | ---: | ---: |
-| `all` | `list` | 173 | 284 KB | 72,811 | 100% |
-| `core` | `list` | 132 | 206 KB | 52,841 | 73% |
-| `drawing` | `list` | 22 | 40 KB | 10,141 | 14% |
+| `all` | `list` | 176 | 288 KB | 73,709 | 100% |
+| `core` | `list` | 132 | 206 KB | 52,841 | 72% |
+| `drawing` | `list` | 25 | 43 KB | 11,039 | 15% |
| `automation` | `list` | 3 | 6 KB | 1,556 | 2% |
| `vba` | `list` | 10 | 17 KB | 4,356 | 6% |
| `docs` | `list` | 6 | 15 KB | 3,916 | 5% |
-| `core,drawing` | `list` | 154 | 246 KB | 62,982 | 87% |
+| `core,drawing` | `list` | 157 | 250 KB | 63,880 | 87% |
| `all` | `search` | 4 | 4 KB | 908 | 1% |
| `core` | `search` | 4 | 4 KB | 908 | 1% |
diff --git a/docs/demos.md b/docs/demos.md
index 3a40d275..e57eb859 100644
--- a/docs/demos.md
+++ b/docs/demos.md
@@ -769,6 +769,37 @@ message; `fit_sheet_scale` keeps SolidWorks's choice instead:
3. `create_drawing_view({"model_path": "...", "view_type": "front", "position_x": 140})`, then the top and right views
4. On a new drawing set up the same way: `create_drawing_view({"model_path": "...", "view_type": "front", "position_x": 140, "fit_sheet_scale": true})`
+### A drawing on two sheets {#two-sheets}
+
+
+
+> *Example prompt:* Draw the bracket's three views on an A3 sheet, then add
+> an A2 sheet called Details at 2:1 with an isometric view.
+
+**What it shows.** `list_sheets`, `add_sheet` and `activate_sheet` work a
+drawing's sheets by name, each reply listing every sheet with its paper
+size, scale, projection and which is active:
+
+| Step | Tools | Expected | Measured |
+| --- | --- | --- | --- |
+| The bracket's front, top and right views on A3 | `create_drawing_view`, `list_sheets` | one sheet, 420 x 297 mm, 1:1 | Sheet1, 420 x 297 mm, 1:1 |
+| A second sheet named `sheet1` | `add_sheet` | refused: names ignore case | `invalid_input`: "a sheet named 'sheet1' already" |
+| An A2 Details sheet at 2:1 | `add_sheet` | 594 x 420 mm, 2:1, active | 594 x 420 mm, 2:1, active |
+| An isometric view on Details | `create_drawing_view` | a fourth view | Drawing View4, isometric |
+| Back to Sheet1, by `SHEET1` | `activate_sheet` | Sheet1 active | Sheet1 active |
+
+`sheet1` is refused **on purpose**: sheet names ignore case, as in
+SolidWorks.
+
+**Tool calls**
+
+1. A 60 x 40 x 40 mm angle bracket with three M6 holes, saved
+2. `create_drawing`, `update_sheet_format({"sheet_format": "a3 - iso"})`, three `create_drawing_view` (front, top, right), `set_sheet_scale({"numerator": 1, "denominator": 1})`, `list_sheets`
+3. `add_sheet({"name": "sheet1"})`, refused on purpose
+4. `add_sheet({"name": "Details", "sheet_format": "a2 - iso", "scale": "2:1"})`
+5. `create_drawing_view({"model_path": "...", "view_type": "isometric", "position_x": 297, "position_y": 210})`
+6. `activate_sheet({"name": "SHEET1"})`
+
### A BOM on an assembly drawing {#bom}

diff --git a/docs/index.md b/docs/index.md
index d0cedad8..10e24854 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -13,7 +13,7 @@
An MCP server that lets AI agents drive SolidWorks: describe a part, and the agent builds it with the server's 123 tools and checks what SolidWorks reports back.
-๐ **173 Tools** | ๐ค **Agent-Ready Workflows** | โก **Automatic COM/VBA Routing** | ๐งช **Schema-Validated Prompt Runs**
+๐ **176 Tools** | ๐ค **Agent-Ready Workflows** | โก **Automatic COM/VBA Routing** | ๐งช **Schema-Validated Prompt Runs**
## Overview
@@ -43,7 +43,7 @@ The project emphasizes an inspect -> classify -> delegate loop instead of blind
### 2) Broad Tool Surface with Practical Coverage
-- 173 tools across modeling, multi-body parts, modelled threads, colours, reference geometry, assemblies, sketching, drawing, engineering data, analysis, export, automation, templates, macros, and docs discovery
+- 176 tools across modeling, multi-body parts, modelled threads, colours, reference geometry, assemblies, sketching, drawing, engineering data, analysis, export, automation, templates, macros, and docs discovery
- one server API surface for both simple operations and advanced workflows
### 3) Reliable Execution Path for Complex Operations
diff --git a/docs/llms.txt b/docs/llms.txt
index b46ab7a8..4a26049c 100644
--- a/docs/llms.txt
+++ b/docs/llms.txt
@@ -36,10 +36,11 @@
## Tool Catalog
-- [Tool Catalog โ All 173 Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/): This reference documents all **173 MCP tools** registered by the SolidWorks MCP server. Each section covers one functional category with parameter tables and copy-paste sample calls.
+- [Tool Catalog โ All 176 Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/): This reference documents all **176 MCP tools** registered by the SolidWorks MCP server. Each section covers one functional category with parameter tables and copy-paste sample calls.
- [Modeling Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/modeling/): Create and manipulate SolidWorks parts, assemblies, and drawings. These are the foundational tools for any CAD workflow โ opening files, creating features (extrude, revolve), and querying/setting driven dimensions.
- [Equation Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/equations/): Read, add, change and delete a part's or assembly's equations and global variables, so one value drives several dimensions and the model stays consistent when it changes.
- [Body Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/bodies/): See, combine, split, move, copy, delete and scale the solid bodies of a part.
+- [Drawing Sheet Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/drawing-sheets/): List a drawing's sheets, add one, and choose the active one.
- [Thread Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/threads/): Modelled threads at standard sizes: external (a bolt or rod) and internal (a tapped hole).
- [Appearance Tools](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/appearance/): Colour the part, a feature, a body or one face, and read a colour back.
- [Reference and Analysis Extras](https://andrewbartels1.com/SolidworksMCP-python/user-guide/tool-catalog/reference-extras/): A coordinate system at a point, the centre-of-mass point, the bounding box, and a face's section properties.
diff --git a/docs/user-guide/tool-catalog/drawing-sheets.md b/docs/user-guide/tool-catalog/drawing-sheets.md
new file mode 100644
index 00000000..107c8d36
--- /dev/null
+++ b/docs/user-guide/tool-catalog/drawing-sheets.md
@@ -0,0 +1,73 @@
+# Drawing Sheet Tools
+
+List a drawing's sheets, add one, and choose the active one.
+
+> **Prerequisite:** an open drawing.
+
+**Total tools in this category: 3**
+
+A drawing's views, dimensions, notes and tables go on its active sheet. With these tools a drawing can take several sheets: a general arrangement on one, enlarged details on another. Sheet names ignore case; an unknown name is refused with the sheets there are.
+
+---
+
+### `list_sheets`
+
+List the active drawing's sheets with each one's paper size, scale and projection, and which is active.
+
+Each sheet has `name`, `active`, `paper_mm` (`[width, height]`), `scale` (`1:2`) and `projection` (`first` or `third` angle). Sheets are read without switching between them.
+
+**Prerequisite:** Active drawing.
+
+**Parameters:** none.
+
+**Sample call:**
+
+```json
+{}
+```
+
+---
+
+### `add_sheet`
+
+Add a sheet to the active drawing, with a format, paper size and scale, and make it the active sheet.
+
+The format is a name such as `a3 - iso` (found in SolidWorks's sheet format folders) or a `.slddrt` path; the paper size comes from the format's name unless given. The new sheet takes the active sheet's projection unless `projection` is given. A name already used is refused.
+
+**Prerequisite:** Active drawing.
+
+**Parameters:**
+
+| Parameter | Type | Required | Default | Description |
+|-----------|------|----------|---------|-------------|
+| `name` | `str` | โ
| | The new sheet's name, e.g. 'Details' |
+| `sheet_format` | `str` | โ | `"a3 - iso"` | A sheet format by name, e.g. 'a3 - iso' or 'a2 - iso', or a .slddrt path |
+| `paper_size` | `str` | โ | | Paper size; read from the format's name when omitted |
+| `scale` | `str` | โ | `"1:1"` | Sheet scale, e.g. '1:2' or '2:1' |
+| `projection` | `str` | โ | | 'first' or 'third' angle projection; the active sheet's when omitted |
+
+**Sample call:**
+
+```json
+{"name": "Details", "sheet_format": "a3 - iso", "scale": "2:1"}
+```
+
+---
+
+### `activate_sheet`
+
+Make a sheet of the active drawing the active one, so new views and notes go on it.
+
+**Prerequisite:** Active drawing.
+
+**Parameters:**
+
+| Parameter | Type | Required | Default | Description |
+|-----------|------|----------|---------|-------------|
+| `name` | `str` | โ
| | The sheet, as list_sheets names it |
+
+**Sample call:**
+
+```json
+{"name": "Sheet1"}
+```
diff --git a/docs/user-guide/tool-catalog/index.md b/docs/user-guide/tool-catalog/index.md
index 46d24b0d..6bc38dc4 100644
--- a/docs/user-guide/tool-catalog/index.md
+++ b/docs/user-guide/tool-catalog/index.md
@@ -1,6 +1,6 @@
-# Tool Catalog โ All 173 Tools
+# Tool Catalog โ All 176 Tools
-This reference documents all **173 MCP tools** registered by the SolidWorks MCP server.
+This reference documents all **176 MCP tools** registered by the SolidWorks MCP server.
Each section covers one functional category with parameter tables and copy-paste sample calls.

@@ -18,6 +18,7 @@ Each section covers one functional category with parameter tables and copy-paste
| [Assembly Tools](assembly.md) | 5 | Exploded views, component patterns and mirrors, and replacing a component with another file. |
| [Sketching Tools](sketching.md) | 27 | Sketches on a plane or a flat face: lines, circles, arcs, slots, splines, polygons, text, fillets, chamfers, trim and extend, construction geometry, relations, dimensions, offsets, mirrors and patterns. |
| [Drawing Tools](drawing.md) | 14 | Drawings from a model: standard, section, detail and exploded views, dimensions, notes, balloons, centre marks, the sheet format and title block, and a drawing check. |
+| [Drawing Sheet Tools](drawing-sheets.md) | 3 | A drawing's sheets: list them with paper, scale and projection, add one, and choose the active one. |
| [Drawing Analysis Tools](drawing-analysis.md) | 1 | Compare two versions of a drawing file. |
| [Drawing Automation Tools](drawing-automation.md) | 7 | Model dimensions laid out without overlaps, datum tags, tolerances, BOM tables, sheet scale and complete A3 drawings. |
| [Engineering Data Tools](engineering-data.md) | 8 | Read and edit the data drawings and BOMs are built from: model dimensions by name, measurements, materials, custom properties and sheet-metal flat patterns. |
diff --git a/docs/user-guide/tools-overview.md b/docs/user-guide/tools-overview.md
index 43eac135..6b5348ba 100644
--- a/docs/user-guide/tools-overview.md
+++ b/docs/user-guide/tools-overview.md
@@ -119,6 +119,14 @@ These read SolidWorks' installed files and never start it
[**14 tools available** :octicons-arrow-right-24:](tool-catalog/drawing.md)
+- :material-file-multiple:{ .lg .middle } **Drawing Sheet Tools**
+
+ ---
+
+ A drawing's sheets: list them, add one with a format and scale, and choose the active one.
+
+ [**3 tools available** :octicons-arrow-right-24:](tool-catalog/drawing-sheets.md)
+
- :material-file-cog:{ .lg .middle } **Drawing Automation**
---
@@ -225,7 +233,7 @@ These read SolidWorks' installed files and never start it
-**Total: 173 Tools**
+**Total: 176 Tools**
## Deprecated tools
diff --git a/mkdocs.yml b/mkdocs.yml
index 6fcb9fe7..48bd03e0 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -51,6 +51,7 @@ nav:
- Modeling: user-guide/tool-catalog/modeling.md
- Equations: user-guide/tool-catalog/equations.md
- Bodies: user-guide/tool-catalog/bodies.md
+ - Drawing Sheets: user-guide/tool-catalog/drawing-sheets.md
- Threads: user-guide/tool-catalog/threads.md
- Appearance: user-guide/tool-catalog/appearance.md
- Reference Extras: user-guide/tool-catalog/reference-extras.md
diff --git a/openspec/changes/drawing-sheets/.openspec.yaml b/openspec/changes/drawing-sheets/.openspec.yaml
new file mode 100644
index 00000000..d24126c0
--- /dev/null
+++ b/openspec/changes/drawing-sheets/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-11-28
diff --git a/openspec/changes/drawing-sheets/design.md b/openspec/changes/drawing-sheets/design.md
new file mode 100644
index 00000000..f4f61d05
--- /dev/null
+++ b/openspec/changes/drawing-sheets/design.md
@@ -0,0 +1,39 @@
+## Context
+
+Motivation: see proposal.md.
+
+**Probe (SolidWorks 2026 SP4, 2026-11-28; a new drawing, closed unsaved):**
+
+- `IDrawingDoc.GetSheetNames()` gives the names in order; a new drawing has
+ `Sheet1` (Letter, 279.4 x 215.9 mm, 1:1, third angle).
+- `ISheet.GetProperties2()`: paper size code, template, scale numerator and
+ denominator, first angle (1) or third (0), width and height (m), a flag.
+ `IDrawingDoc.Sheet(name)` gives a sheet without activating it.
+- `IDrawingDoc.NewSheet4(name, paperSize, template 12 (custom), scale1,
+ scale2, firstAngle, formatPath, width m, height m, "Default", 0 x 6)`
+ adds the sheet and makes it active; it returns False for a name in use.
+- `IDrawingDoc.ActivateSheet(name)` returns False for a missing name.
+
+## Goals / Non-Goals
+
+**Goals:** see, add and choose sheets, by name, ignoring case.
+
+**Non-Goals:** deleting, renaming or reordering sheets; per-sheet title
+blocks (`update_title_block` writes the drawing's properties); the rest of
+item 37 (callouts, auxiliary and break views, revision table).
+
+## Decisions
+
+1. **On the drawing pack.** `_pack_run` (drawing only, on the connect
+ thread), `_pack_format_path`, `paper_for`, `parse_scale` and
+ `PAPER_SIZES` are reused, so a format is found the way
+ `update_sheet_format` finds it.
+2. **Refused before SolidWorks.** A name in use and an unknown sheet are
+ refused by the rules with the sheets listed, rather than by reading
+ SolidWorks's False.
+3. **Projection inherited.** A new sheet takes the active sheet's
+ projection unless one is given, so a drawing stays consistent.
+4. **Observed live:** `create_drawing_view` rescales the active sheet to
+ fit its view, so a sheet added at 1:2 read 5:1 after an isometric view
+ was placed on it. That is `create_drawing_view`'s behaviour; a question
+ for the user.
diff --git a/openspec/changes/drawing-sheets/proposal.md b/openspec/changes/drawing-sheets/proposal.md
new file mode 100644
index 00000000..8919a7fb
--- /dev/null
+++ b/openspec/changes/drawing-sheets/proposal.md
@@ -0,0 +1,36 @@
+## Why
+
+A drawing can hold several sheets, but an agent can't see them, add one or
+choose which one views go on: every view, dimension and note lands on the
+sheet that happens to be active. A general arrangement on one sheet and
+enlarged details on another is the usual layout of a drawing of any size.
+Queue item 37 (drawing sheets and callouts), first part: the sheets.
+
+## What Changes
+
+- **`list_sheets`**: the active drawing's sheets with each one's paper size,
+ scale and projection, and which is active.
+- **`add_sheet`**: a new sheet with a format (e.g. `a3 - iso`), paper size,
+ scale and projection (the active sheet's by default), made active.
+- **`activate_sheet`**: choose the active sheet by name.
+- Three tools, beta until the live demo. Callouts, auxiliary and break
+ views, the revision table and ordinate dimensions stay in item 37.
+
+## Capabilities
+
+### New Capabilities
+
+- `tools/drawing-sheets`: `list_sheets`, `add_sheet`, `activate_sheet`.
+
+### Modified Capabilities
+
+None.
+
+## Impact
+
+- `adapters/sheet_rules.py` (pure), `adapters/solidworks/drawing_sheets.py`
+ (COM, on the drawing pack's helpers), `adapters/mock_drawing_sheets.py`;
+ base, circuit breaker and connection pool wrappers.
+- `tools/drawing_sheets.py`, in the `drawing` toolset; support levels,
+ hints, classifier rules.
+- Docs: a catalog page and counts. Tests mirroring src; a live test.
diff --git a/openspec/changes/drawing-sheets/specs/tools/drawing-sheets/spec.md b/openspec/changes/drawing-sheets/specs/tools/drawing-sheets/spec.md
new file mode 100644
index 00000000..3ff0349a
--- /dev/null
+++ b/openspec/changes/drawing-sheets/specs/tools/drawing-sheets/spec.md
@@ -0,0 +1,39 @@
+## ADDED Requirements
+
+### Requirement: The drawing's sheets
+`list_sheets` SHALL list the active drawing's sheets in order, each with
+`name`, `active`, `paper_mm` (`[width, height]`), `scale` (`"1:2"`) and
+`projection` (`first` or `third`), read without changing the active sheet,
+with `count` and `active`. It SHALL fail when the active document is not a
+drawing.
+
+#### Scenario: A new drawing
+- **WHEN** it is called on a new drawing
+- **THEN** it lists `Sheet1`, active, with its paper size and scale
+
+### Requirement: A new sheet
+`add_sheet` SHALL add a sheet named `name` with the format `sheet_format`
+(a name found in SolidWorks's sheet format folders or a `.slddrt` path),
+the paper size (from the format's name unless given), `scale` and
+`projection` (the active sheet's unless given), make it active, and reply
+with `added`, `sheet_format` and the listing after. A name in use (ignoring
+case), an unknown format, a bad scale or projection SHALL fail with
+`invalid_input`, changing nothing.
+
+#### Scenario: A details sheet
+- **WHEN** it is called with `name` "Details", `sheet_format` "a2 - iso"
+ and `scale` "1:2"
+- **THEN** the listing has Details, active, 594 x 420 mm, at 1:2
+
+#### Scenario: A name in use
+- **WHEN** it is called with `name` "sheet1" on a drawing with Sheet1
+- **THEN** it fails with `invalid_input`, listing the sheets
+
+### Requirement: The active sheet
+`activate_sheet` SHALL make the sheet named `name` (ignoring case) the
+active one and reply with the listing after. An unknown name SHALL fail
+with `invalid_input`, listing the sheets.
+
+#### Scenario: Back to the first sheet
+- **WHEN** it is called with "SHEET1" while Details is active
+- **THEN** Sheet1 is active
diff --git a/openspec/changes/drawing-sheets/tasks.md b/openspec/changes/drawing-sheets/tasks.md
new file mode 100644
index 00000000..645db9ab
--- /dev/null
+++ b/openspec/changes/drawing-sheets/tasks.md
@@ -0,0 +1,23 @@
+## 1. Probe
+
+- [x] 1.1 Probe GetSheetNames, GetProperties2, NewSheet4 and ActivateSheet
+ on SolidWorks 2026 (answers in design.md)
+
+## 2. Build
+
+- [x] 2.1 `adapters/sheet_rules.py`; base, circuit breaker and pool wrappers
+- [x] 2.2 `adapters/solidworks/drawing_sheets.py` and the mock
+- [x] 2.3 `tools/drawing_sheets.py`; registration, drawing toolset, support
+ levels (beta), hints, classifier rules
+
+## 3. Tests
+
+- [x] 3.1 Unit tests mirroring src, 100% coverage
+- [x] 3.2 Live test `tests/live/test_live_sw_drawing_sheets.py` (passed
+ 2026-11-28: Sheet1 with a front view; "sheet1" refused; Details A2
+ at 1:2 active with an isometric view; back to Sheet1)
+
+## 4. Docs
+
+- [x] 4.1 Catalog page, counts, CHANGELOG, queue
+- [x] 4.2 A demo and GIF once the user has seen it
diff --git a/openspec/queue.md b/openspec/queue.md
index 440155c4..61a464b0 100644
--- a/openspec/queue.md
+++ b/openspec/queue.md
@@ -47,7 +47,7 @@ Last updated 2026-11-25.
| 34 | Helix and swept cuts: helix/spiral, a swept cut (`create_sweep` only adds material), thicken; springs and modelled threads | none | `helix-and-swept-cuts` | Built 2026-11-25: `create_helix`, `create_cut_sweep`, named and circular sweep profiles, both sweeps measured. Live demos passed 2026-11-26; beta for now (the user's choice) |
| 35 | Multi-body tools: combine (add, subtract, common), split, move/copy, delete/keep a body, scale | none | `multi-body-tools` | Done 2026-11-27: six tools, beta; the user ran the three demos (boolean logic on a cube and a sphere, split and keep, copies and scale) |
| 36 | Appearance and colour: set a part's, body's or face's colour and read it back | none | `appearance-and-reference-tools` | Built 2026-11-28 with item 39: `set_appearance`, `get_appearance`; live tests pass; beta until the user's demo |
-| 37 | Drawing sheets and callouts: new and active sheet, auxiliary, break and broken-out views, hole callouts, ordinate dimensions, surface finish, revision table | #158 (part) | not yet written | Planned |
+| 37 | Drawing sheets and callouts: new and active sheet, auxiliary, break and broken-out views, hole callouts, ordinate dimensions, surface finish, revision table | #158 (part) | `drawing-sheets` (sheets only) | Sheets built 2026-11-28: `list_sheets`, `add_sheet`, `activate_sheet`; live test passes; beta until the user's demo. Callouts, auxiliary, break and broken-out views, ordinate dimensions, surface finish and the revision table are left |
| 38 | Weldments: structural members, trim/extend, end caps, gussets, cut list | none | not yet written | Planned (needs live probes: the profile library location varies) |
| 39 | Reference and analysis extras: coordinate system, bounding box, centre-of-mass point, section properties; wrap (text on a curved face) | none | `appearance-and-reference-tools` | Built 2026-11-28 except wrap: `create_coordinate_system` (model axes only; SolidWorks ignores the flips with no axis selected), `create_center_of_mass_point`, `create_bounding_box`, `get_section_properties`; live tests pass; beta until the user's demo. Wrap and turned axes are left |
| 40 | Structure review (the user's request 2026-11-19), not a rewrite: the adapter wrappers (`base`, `circuit_breaker`, `connection_pool`, each about 2,500 lines of near-identical per-tool methods) repeat every adapter method, and the largest modules (`mock_adapter` 4,900, `io` 4,000, `features` 3,800, `modeling` 3,200, `sketch` 2,900 lines) should split by topic, as `adapters/solidworks/` already does. Measure the repetition, propose a SOLID structure (one generic forwarding path; one module per topic), and move to it in steps that keep every test passing. Widened 2026-11-25 (the user's request): also audit every function for full type hints, Google-style docstrings with every section (Args, Returns, Raises, and an Example where the use isn't obvious), and inline comments that explain the logic, so each function's job is obvious; and the code sprawl: files and helpers that have grown in miscellaneous places, and a layout that scales to more tools and features (where a new tool's adapter method, wrapper, mock, schema and tests go). Its own PR, separate from feature work | none | not yet written | Planned (last) |
diff --git a/src/solidworks_mcp/adapters/base.py b/src/solidworks_mcp/adapters/base.py
index ee45da30..fdaeb1c7 100644
--- a/src/solidworks_mcp/adapters/base.py
+++ b/src/solidworks_mcp/adapters/base.py
@@ -481,6 +481,25 @@ class ThreadParameters(BaseModel):
lead_in: bool = False
+class AddSheetParameters(BaseModel):
+ """A new drawing sheet.
+
+ Attributes:
+ name (str): The sheet's name.
+ sheet_format (str): A format name (``a3 - iso``) or a ``.slddrt`` path.
+ paper_size (str | None): a4 to a0; read from the format name when None.
+ scale (str): The sheet scale, e.g. ``1:2``.
+ projection (str | None): ``first`` or ``third`` angle; the active
+ sheet's when None.
+ """
+
+ name: str
+ sheet_format: str = "a3 - iso"
+ paper_size: str | None = None
+ scale: str = "1:1"
+ projection: str | None = None
+
+
class LoftParameters(BaseModel):
"""Parameters for loft operations.
@@ -1010,6 +1029,47 @@ async def scale_body(
error="scale_body is not implemented by this adapter",
)
+ async def list_sheets(self) -> AdapterResult[dict[str, Any]]:
+ """The active drawing's sheets: name, paper, scale, projection, active.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
+ """
+ return AdapterResult(
+ status=AdapterResultStatus.ERROR,
+ error="list_sheets is not implemented by this adapter",
+ )
+
+ async def add_sheet(
+ self, params: AddSheetParameters
+ ) -> AdapterResult[dict[str, Any]]:
+ """Add a sheet to the active drawing and make it the active one.
+
+ Args:
+ params: The name, format, paper, scale and projection.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
+ """
+ return AdapterResult(
+ status=AdapterResultStatus.ERROR,
+ error="add_sheet is not implemented by this adapter",
+ )
+
+ async def activate_sheet(self, name: str) -> AdapterResult[dict[str, Any]]:
+ """Make a sheet of the active drawing the active one.
+
+ Args:
+ name: The sheet.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
+ """
+ return AdapterResult(
+ status=AdapterResultStatus.ERROR,
+ error="activate_sheet is not implemented by this adapter",
+ )
+
async def list_thread_sizes(self, standard: str) -> AdapterResult[dict[str, Any]]:
"""The sizes SolidWorks's thread profiles hold for a standard.
diff --git a/src/solidworks_mcp/adapters/circuit_breaker.py b/src/solidworks_mcp/adapters/circuit_breaker.py
index 1bfd7cd4..945774d4 100644
--- a/src/solidworks_mcp/adapters/circuit_breaker.py
+++ b/src/solidworks_mcp/adapters/circuit_breaker.py
@@ -17,6 +17,7 @@
AdapterHealth,
AdapterResult,
AdapterResultStatus,
+ AddSheetParameters,
AppearanceParameters,
AppearanceTarget,
BoundingBoxParameters,
@@ -1435,6 +1436,30 @@ async def get_section_properties(
input_dict=_to_input_dict(params),
)
+ async def list_sheets(self) -> AdapterResult[dict[str, Any]]:
+ """The drawing's sheets. Through the circuit breaker."""
+ return await self._execute_with_circuit_breaker(
+ "list_sheets", lambda: self.adapter.list_sheets(), input_dict={}
+ )
+
+ async def add_sheet(
+ self, params: AddSheetParameters
+ ) -> AdapterResult[dict[str, Any]]:
+ """Add a sheet. Through the circuit breaker."""
+ return await self._execute_with_circuit_breaker(
+ "add_sheet",
+ lambda: self.adapter.add_sheet(params),
+ input_dict=_to_input_dict(params),
+ )
+
+ async def activate_sheet(self, name: str) -> AdapterResult[dict[str, Any]]:
+ """Activate a sheet. Through the circuit breaker."""
+ return await self._execute_with_circuit_breaker(
+ "activate_sheet",
+ lambda: self.adapter.activate_sheet(name),
+ input_dict={"name": name},
+ )
+
async def create_loft(
self, params: LoftParameters
) -> AdapterResult[SolidWorksFeature]:
diff --git a/src/solidworks_mcp/adapters/connection_pool.py b/src/solidworks_mcp/adapters/connection_pool.py
index fa686fb3..54db33d4 100644
--- a/src/solidworks_mcp/adapters/connection_pool.py
+++ b/src/solidworks_mcp/adapters/connection_pool.py
@@ -16,6 +16,7 @@
AdapterHealth,
AdapterResult,
AdapterResultStatus,
+ AddSheetParameters,
AppearanceParameters,
AppearanceTarget,
BoundingBoxParameters,
@@ -1240,6 +1241,26 @@ async def create_thread(
"create_thread", lambda adapter: adapter.create_thread(params)
)
+ async def list_sheets(self) -> AdapterResult[dict[str, Any]]:
+ """The drawing's sheets. Using the pool."""
+ return await self._execute_with_pool(
+ "list_sheets", lambda adapter: adapter.list_sheets()
+ )
+
+ async def add_sheet(
+ self, params: AddSheetParameters
+ ) -> AdapterResult[dict[str, Any]]:
+ """Add a sheet. Using the pool."""
+ return await self._execute_with_pool(
+ "add_sheet", lambda adapter: adapter.add_sheet(params)
+ )
+
+ async def activate_sheet(self, name: str) -> AdapterResult[dict[str, Any]]:
+ """Activate a sheet. Using the pool."""
+ return await self._execute_with_pool(
+ "activate_sheet", lambda adapter: adapter.activate_sheet(name)
+ )
+
async def create_loft(
self, params: LoftParameters
) -> AdapterResult[SolidWorksFeature]:
diff --git a/src/solidworks_mcp/adapters/mock_adapter.py b/src/solidworks_mcp/adapters/mock_adapter.py
index 27cce339..9f6bec1a 100644
--- a/src/solidworks_mcp/adapters/mock_adapter.py
+++ b/src/solidworks_mcp/adapters/mock_adapter.py
@@ -32,6 +32,7 @@
from .mock_appearance import MockAppearanceMixin
from .mock_bodies import MockBodiesMixin
from .mock_drawing_pack import MockDrawingPackMixin
+from .mock_drawing_sheets import MockDrawingSheetsMixin
from .mock_equations import MockEquationsMixin
from .mock_reference_extras import MockReferenceExtrasMixin
from .mock_sheet_metal import MockSheetMetalMixin
@@ -148,6 +149,7 @@ def __bool__(self) -> bool:
class MockSolidWorksAdapter(
+ MockDrawingSheetsMixin,
MockThreadsMixin,
MockAppearanceMixin,
MockReferenceExtrasMixin,
diff --git a/src/solidworks_mcp/adapters/mock_drawing_sheets.py b/src/solidworks_mcp/adapters/mock_drawing_sheets.py
new file mode 100644
index 00000000..745a32b6
--- /dev/null
+++ b/src/solidworks_mcp/adapters/mock_drawing_sheets.py
@@ -0,0 +1,128 @@
+"""The mock adapter's drawing sheets (queue item 37).
+
+The mock drawing starts with ``Sheet1`` (A3, 1:1, third angle). Adding a
+sheet makes it active and sets the drawing pack's paper to its size, as the
+real adapter's sheet does. Refusals use :mod:`sheet_rules`.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+from ..exceptions import InputRefused
+from . import sheet_rules as rules
+from .base import AdapterResult, AdapterResultStatus, AddSheetParameters
+from .solidworks.drawing_pack import PAPER_SIZES, paper_for, parse_scale
+
+
+def _error(message: str) -> AdapterResult[dict[str, Any]]:
+ """An error result."""
+ return AdapterResult(status=AdapterResultStatus.ERROR, error=message)
+
+
+class MockDrawingSheetsMixin:
+ """``list_sheets``, ``add_sheet`` and ``activate_sheet``, in memory."""
+
+ def _sheets_state(self) -> dict[str, Any]:
+ """The mock drawing's sheets and the active one."""
+ state: dict[str, Any] = self._pack_state() # type: ignore[attr-defined]
+ if "sheets" not in state:
+ state["sheets"] = [
+ {
+ "name": "Sheet1",
+ "paper": state["paper"],
+ "scale": (1.0, 1.0),
+ "first": False,
+ }
+ ]
+ state["active_sheet"] = "Sheet1"
+ return state
+
+ def _sheet_listing(self) -> dict[str, Any]:
+ """Every sheet's entry, the active one marked."""
+ state = self._sheets_state()
+ sheets = []
+ for sheet in state["sheets"]:
+ _, width, height = PAPER_SIZES[sheet["paper"]]
+ props = [
+ 0,
+ 12,
+ *sheet["scale"],
+ sheet["first"],
+ width / 1000,
+ height / 1000,
+ 1,
+ ]
+ sheets.append(
+ rules.sheet_entry(
+ sheet["name"], props, sheet["name"] == state["active_sheet"]
+ )
+ )
+ return {"sheets": sheets, "count": len(sheets), "active": state["active_sheet"]}
+
+ def _guard(self, operation: str) -> AdapterResult[dict[str, Any]] | None:
+ """An error unless a drawing is active."""
+ guard: AdapterResult[dict[str, Any]] | None = self._pack_guard(operation) # type: ignore[attr-defined]
+ return guard
+
+ async def list_sheets(self) -> AdapterResult[dict[str, Any]]:
+ """Mock: the drawing's sheets."""
+ refused = self._guard("list_sheets")
+ if refused:
+ return refused
+ return AdapterResult(
+ status=AdapterResultStatus.SUCCESS, data=self._sheet_listing()
+ )
+
+ async def add_sheet(
+ self, params: AddSheetParameters
+ ) -> AdapterResult[dict[str, Any]]:
+ """Mock: add a sheet and make it active."""
+ refused = self._guard("add_sheet")
+ if refused:
+ return refused
+ state = self._sheets_state()
+ try:
+ rules.check_new_sheet(
+ [s["name"] for s in state["sheets"]], params.name, params.projection
+ )
+ size = paper_for(params.sheet_format, params.paper_size)
+ scale = parse_scale(params.scale)
+ except (InputRefused, ValueError) as exc:
+ return _error(str(exc))
+ current = next(s for s in state["sheets"] if s["name"] == state["active_sheet"])
+ first = (
+ current["first"]
+ if params.projection is None
+ else params.projection == "first"
+ )
+ name = params.name.strip()
+ state["sheets"].append(
+ {"name": name, "paper": size, "scale": scale, "first": first}
+ )
+ state["active_sheet"] = name
+ state["paper"] = size
+ return AdapterResult(
+ status=AdapterResultStatus.SUCCESS,
+ data={
+ "added": name,
+ "sheet_format": f"{params.sheet_format}.slddrt",
+ **self._sheet_listing(),
+ },
+ )
+
+ async def activate_sheet(self, name: str) -> AdapterResult[dict[str, Any]]:
+ """Mock: make a sheet the active one."""
+ refused = self._guard("activate_sheet")
+ if refused:
+ return refused
+ state = self._sheets_state()
+ try:
+ real = rules.resolve_sheet([s["name"] for s in state["sheets"]], name)
+ except InputRefused as exc:
+ return _error(str(exc))
+ state["active_sheet"] = real
+ state["paper"] = next(s["paper"] for s in state["sheets"] if s["name"] == real)
+ return AdapterResult(
+ status=AdapterResultStatus.SUCCESS, data=self._sheet_listing()
+ )
diff --git a/src/solidworks_mcp/adapters/pywin32_adapter.py b/src/solidworks_mcp/adapters/pywin32_adapter.py
index 21dfc656..6f693558 100644
--- a/src/solidworks_mcp/adapters/pywin32_adapter.py
+++ b/src/solidworks_mcp/adapters/pywin32_adapter.py
@@ -31,6 +31,7 @@
SolidWorksConfigurationsMixin,
SolidWorksDocumentationMixin,
SolidWorksDrawingPackMixin,
+ SolidWorksDrawingSheetsMixin,
SolidWorksDrawingStandardMixin,
SolidWorksEquationsMixin,
SolidWorksFeaturesMixin,
@@ -1727,6 +1728,7 @@ def _is_feature_suppressed(self, feature: Any) -> bool:
class PyWin32Adapter(
+ SolidWorksDrawingSheetsMixin,
SolidWorksThreadsMixin,
SolidWorksAppearanceMixin,
SolidWorksReferenceExtrasMixin,
diff --git a/src/solidworks_mcp/adapters/sheet_rules.py b/src/solidworks_mcp/adapters/sheet_rules.py
new file mode 100644
index 00000000..e16cf442
--- /dev/null
+++ b/src/solidworks_mcp/adapters/sheet_rules.py
@@ -0,0 +1,75 @@
+"""Rules for drawing sheets (queue item 37), shared by the adapter and the mock.
+
+- :func:`sheet_entry` turns a sheet's ``GetProperties2`` into a listing entry;
+- :func:`resolve_sheet` finds a sheet by name, ignoring case, or refuses by
+ listing them;
+- :func:`check_new_sheet` refuses a new sheet's name or projection.
+
+``ISheet.GetProperties2`` gives, measured on SolidWorks 2026: paper size,
+template, scale numerator and denominator, first angle (1) or third angle
+(0), width and height in metres, and a last flag.
+"""
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+from typing import Any
+
+from ..exceptions import InputRefused
+
+PROJECTIONS = ("first", "third")
+
+
+def sheet_entry(name: str, props: Any, active: bool) -> dict[str, Any]:
+ """One sheet as ``list_sheets`` lists it.
+
+ Args:
+ name: The sheet's name.
+ props: ``GetProperties2``'s values, or None when unreadable.
+ active: Whether it is the active sheet.
+
+ Returns:
+ dict[str, Any]: ``name``, ``active``, and when readable
+ ``paper_mm`` [width, height], ``scale`` ("1:2") and ``projection``.
+ """
+ entry: dict[str, Any] = {"name": name, "active": active}
+ values = list(props) if isinstance(props, (list, tuple)) else []
+ if len(values) >= 7:
+ entry["paper_mm"] = [
+ round(float(values[5]) * 1000, 1),
+ round(float(values[6]) * 1000, 1),
+ ]
+ entry["scale"] = f"{float(values[2]):g}:{float(values[3]):g}"
+ entry["projection"] = "first" if values[4] else "third"
+ return entry
+
+
+def resolve_sheet(names: Sequence[str], wanted: str) -> str:
+ """A sheet's name as the drawing spells it.
+
+ Raises:
+ InputRefused: No sheet of that name; the message lists them.
+ """
+ for name in names:
+ if name.lower() == wanted.strip().lower():
+ return name
+ raise InputRefused(
+ f"No sheet named '{wanted}'; the drawing has {', '.join(names) or 'none'}."
+ )
+
+
+def check_new_sheet(names: Sequence[str], name: str, projection: str | None) -> None:
+ """Refuse a new sheet's name that is empty or taken, or a bad projection.
+
+ Raises:
+ InputRefused: Saying which.
+ """
+ if not name.strip():
+ raise InputRefused("A new sheet needs a name.")
+ if any(existing.lower() == name.strip().lower() for existing in names):
+ raise InputRefused(
+ f"The drawing has a sheet named '{name}' already; its sheets are "
+ f"{', '.join(names)}."
+ )
+ if projection is not None and projection not in PROJECTIONS:
+ raise InputRefused("projection must be 'first' or 'third'.")
diff --git a/src/solidworks_mcp/adapters/solidworks/__init__.py b/src/solidworks_mcp/adapters/solidworks/__init__.py
index 22f01037..11016248 100644
--- a/src/solidworks_mcp/adapters/solidworks/__init__.py
+++ b/src/solidworks_mcp/adapters/solidworks/__init__.py
@@ -6,6 +6,7 @@
from .configurations import SolidWorksConfigurationsMixin
from .documentation import SolidWorksDocumentationMixin
from .drawing_pack import SolidWorksDrawingPackMixin
+from .drawing_sheets import SolidWorksDrawingSheetsMixin
from .drawing_standard import SolidWorksDrawingStandardMixin
from .equations import SolidWorksEquationsMixin
from .features import SolidWorksFeaturesMixin
@@ -26,6 +27,7 @@
"SolidWorksConfigurationsMixin",
"SolidWorksDocumentationMixin",
"SolidWorksDrawingPackMixin",
+ "SolidWorksDrawingSheetsMixin",
"SolidWorksDrawingStandardMixin",
"SolidWorksEquationsMixin",
"SolidWorksFeaturesMixin",
diff --git a/src/solidworks_mcp/adapters/solidworks/drawing_sheets.py b/src/solidworks_mcp/adapters/solidworks/drawing_sheets.py
new file mode 100644
index 00000000..24d018b7
--- /dev/null
+++ b/src/solidworks_mcp/adapters/solidworks/drawing_sheets.py
@@ -0,0 +1,156 @@
+"""Drawing sheets on SolidWorks (queue item 37): list, add and activate.
+
+Measured on SolidWorks 2026 (design.md of the ``drawing-sheets`` change):
+``IDrawingDoc.GetSheetNames`` lists them; ``IDrawingDoc.Sheet(name)`` gives
+one without activating it; ``NewSheet4`` with a custom format (template 12,
+the paper size code and size in metres, as ``SetupSheet5`` takes them) adds
+one and makes it active, and returns False for a name in use;
+``ActivateSheet`` returns False for a missing name.
+
+Every call runs on the connect thread through the drawing pack's
+``_pack_run``, which refuses anything but a drawing.
+"""
+
+from __future__ import annotations
+
+from typing import Any, cast
+
+from ...exceptions import InputRefused
+from .. import sheet_rules as rules
+from .. import sw_type_info
+from ..base import AdapterResult, AddSheetParameters
+from .com_utils import as_list
+from .drawing_pack import PAPER_SIZES, TEMPLATE_CUSTOM, paper_for, parse_scale
+
+
+class SolidWorksDrawingSheetsMixin:
+ """``list_sheets``, ``add_sheet`` and ``activate_sheet``."""
+
+ def _sheet_names(self, drawing: Any) -> list[str]:
+ """The drawing's sheet names, in order."""
+ adapter: Any = self
+ return [
+ str(n) for n in as_list(adapter._attempt(lambda: drawing.GetSheetNames()))
+ ]
+
+ def _active_sheet(self, drawing: Any) -> str:
+ """The active sheet's name."""
+ adapter: Any = self
+ sheet = sw_type_info.flagged(
+ adapter._attempt(lambda: drawing.GetCurrentSheet()), "ISheet"
+ )
+ return str(adapter._attempt(lambda: sheet.GetName(), default=""))
+
+ def _sheet_listing(self, drawing: Any) -> dict[str, Any]:
+ """Every sheet's entry, the active one marked, read without switching."""
+ adapter: Any = self
+ active = self._active_sheet(drawing)
+ sheets = []
+ for name in self._sheet_names(drawing):
+ sheet = sw_type_info.flagged(
+ adapter._attempt(lambda n=name: drawing.Sheet(n)), "ISheet"
+ )
+ props = adapter._attempt(lambda s=sheet: s.GetProperties2())
+ sheets.append(rules.sheet_entry(name, props, name == active))
+ return {"sheets": sheets, "count": len(sheets), "active": active}
+
+ async def list_sheets(self) -> AdapterResult[dict[str, Any]]:
+ """The active drawing's sheets.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: ``sheets`` (see
+ :func:`..sheet_rules.sheet_entry`), ``count`` and ``active``.
+ """
+ adapter: Any = self
+ return cast(
+ AdapterResult[dict[str, Any]],
+ adapter._pack_run(
+ "list_sheets", lambda: self._sheet_listing(adapter._pack_drawing())
+ ),
+ )
+
+ async def add_sheet(
+ self, params: AddSheetParameters
+ ) -> AdapterResult[dict[str, Any]]:
+ """Add a sheet and make it active.
+
+ Args:
+ params: The name, format, paper, scale and projection.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: ``added``, ``sheet_format`` and the
+ listing after.
+ """
+ adapter: Any = self
+
+ def build() -> dict[str, Any]:
+ drawing = adapter._pack_drawing()
+ rules.check_new_sheet(
+ self._sheet_names(drawing), params.name, params.projection
+ )
+ try:
+ size = paper_for(params.sheet_format, params.paper_size)
+ scale = parse_scale(params.scale)
+ except ValueError as exc:
+ raise InputRefused(str(exc)) from exc
+ path = adapter._pack_format_path(params.sheet_format)
+ if params.projection is None:
+ current = sw_type_info.flagged(drawing.GetCurrentSheet(), "ISheet")
+ props = as_list(adapter._attempt(lambda: current.GetProperties2()))
+ first_angle = bool(props[4]) if len(props) >= 5 else False
+ else:
+ first_angle = params.projection == "first"
+ code, width, height = PAPER_SIZES[size]
+ made = drawing.NewSheet4(
+ params.name.strip(),
+ code,
+ TEMPLATE_CUSTOM,
+ scale[0],
+ scale[1],
+ first_angle,
+ path,
+ width / 1000.0,
+ height / 1000.0,
+ "Default",
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ )
+ if not made:
+ raise RuntimeError(f"SolidWorks added no sheet '{params.name}'.")
+ return {
+ "added": params.name.strip(),
+ "sheet_format": path,
+ **self._sheet_listing(drawing),
+ }
+
+ return cast(
+ AdapterResult[dict[str, Any]],
+ adapter._pack_run("add_sheet", build),
+ )
+
+ async def activate_sheet(self, name: str) -> AdapterResult[dict[str, Any]]:
+ """Make a sheet the active one.
+
+ Args:
+ name: The sheet, ignoring case.
+
+ Returns:
+ AdapterResult[dict[str, Any]]: The listing after.
+ """
+ adapter: Any = self
+
+ def build() -> dict[str, Any]:
+ drawing = adapter._pack_drawing()
+ real = rules.resolve_sheet(self._sheet_names(drawing), name)
+ if not drawing.ActivateSheet(real):
+ raise RuntimeError(f"SolidWorks did not activate sheet '{real}'.")
+ return self._sheet_listing(drawing)
+
+ return cast(
+ AdapterResult[dict[str, Any]],
+ adapter._pack_run("activate_sheet", build),
+ )
diff --git a/src/solidworks_mcp/tools/__init__.py b/src/solidworks_mcp/tools/__init__.py
index c8a22808..f9a08085 100644
--- a/src/solidworks_mcp/tools/__init__.py
+++ b/src/solidworks_mcp/tools/__init__.py
@@ -17,6 +17,7 @@
from .drawing import register_drawing_tools
from .drawing_analysis import register_drawing_analysis_tools
from .drawing_automation import register_drawing_automation_tools
+from .drawing_sheets import register_drawing_sheet_tools
from .engineering_data import register_engineering_data_tools
from .equations import register_equation_tools
from .export import register_export_tools
@@ -56,6 +57,7 @@ async def register_tools(mcp: FastMCP, adapter: Any, config: Any) -> int:
await register_drawing_tools(mcp, adapter, config)
await register_drawing_analysis_tools(mcp, adapter, config)
await register_drawing_automation_tools(mcp, adapter, config)
+ await register_drawing_sheet_tools(mcp, adapter, config)
await register_engineering_data_tools(mcp, adapter, config)
await register_analysis_tools(mcp, adapter, config)
await register_export_tools(mcp, adapter, config)
diff --git a/src/solidworks_mcp/tools/drawing_sheets.py b/src/solidworks_mcp/tools/drawing_sheets.py
new file mode 100644
index 00000000..63196312
--- /dev/null
+++ b/src/solidworks_mcp/tools/drawing_sheets.py
@@ -0,0 +1,159 @@
+"""Drawing sheets: list them, add one, and choose the active one (queue item 37).
+
+A drawing's views, dimensions and notes go on its active sheet; these tools
+let an agent spread a drawing over several sheets: a general arrangement on
+one, details on another.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from fastmcp import FastMCP
+from pydantic import Field
+
+from ..adapters.base import AddSheetParameters, SolidWorksAdapter
+from .input_compat import CompatInput
+from .tool_boundary import (
+ normalize_input,
+ require_capability,
+ require_success,
+ with_tool_boundary,
+)
+
+
+class AddSheetInput(CompatInput):
+ """Input schema for a new sheet.
+
+ Attributes:
+ name (str): The sheet's name.
+ sheet_format (str): A format name or ``.slddrt`` path.
+ paper_size (str | None): a4 to a0.
+ scale (str): e.g. ``1:2``.
+ projection (str | None): ``first`` or ``third``.
+ """
+
+ name: str = Field(min_length=1, description="The new sheet's name, e.g. 'Details'")
+ sheet_format: str = Field(
+ default="a3 - iso",
+ description="A sheet format by name, e.g. 'a3 - iso' or 'a2 - iso', or a "
+ ".slddrt path",
+ )
+ paper_size: Literal["a4", "a3", "a2", "a1", "a0"] | None = Field(
+ default=None,
+ description="Paper size; read from the format's name when omitted",
+ )
+ scale: str = Field(default="1:1", description="Sheet scale, e.g. '1:2' or '2:1'")
+ projection: Literal["first", "third"] | None = Field(
+ default=None,
+ description="'first' or 'third' angle projection; the active sheet's when "
+ "omitted",
+ )
+
+
+class ActivateSheetInput(CompatInput):
+ """Input schema for choosing the active sheet.
+
+ Attributes:
+ name (str): The sheet.
+ """
+
+ name: str = Field(min_length=1, description="The sheet, as list_sheets names it")
+
+
+async def register_drawing_sheet_tools(
+ mcp: FastMCP, adapter: SolidWorksAdapter, config: Any
+) -> int:
+ """Register the drawing sheet tools with FastMCP.
+
+ Args:
+ mcp (FastMCP): The server.
+ adapter (SolidWorksAdapter): The adapter the tools call.
+ config (Any): Configuration values (unused).
+
+ Returns:
+ int: How many tools were registered.
+ """
+ mcp = with_tool_boundary(mcp)
+
+ @mcp.tool()
+ async def list_sheets() -> dict[str, Any]:
+ """List the active drawing's sheets with each one's paper size, scale and projection, and which is active.
+
+ Views, dimensions and notes go on the active sheet; change it with
+ `activate_sheet`. Needs: an open drawing. Read-only. Returns: `sheets`,
+ each with `name`, `active`, `paper_mm` [width, height], `scale` and
+ `projection`; `count` and `active`.
+ """
+ require_capability(adapter, "list_sheets", "Active adapter can't read sheets")
+ result = await adapter.list_sheets()
+ require_success(result, "Failed to list the sheets")
+ data = result.data or {}
+ return {
+ "status": "success",
+ "message": f"{data.get('count', 0)} sheet(s); active: {data.get('active')}",
+ **data,
+ "execution_time": result.execution_time,
+ }
+
+ @mcp.tool()
+ async def add_sheet(input_data: AddSheetInput) -> dict[str, Any]:
+ """Add a sheet to the active drawing, with a format, paper size and scale, and make it the active sheet.
+
+ E.g. a second sheet for details at 2:1. The new sheet takes the active
+ sheet's projection unless `projection` is given. Fails, changing
+ nothing, for a name already used, an unknown format, or a bad scale.
+ Then add views with `create_drawing_view`; `activate_sheet` goes back.
+ Needs: an open drawing. Changes: adds a sheet. Returns: `added`,
+ `sheet_format` and the `sheets` after.
+
+ Args:
+ input_data: `name`; `sheet_format`, `paper_size`, `scale` and
+ `projection` optional.
+
+ Returns:
+ dict[str, Any]: The sheets after.
+ """
+ input_data = normalize_input(input_data, AddSheetInput)
+ require_capability(adapter, "add_sheet", "Active adapter can't add sheets")
+ result = await adapter.add_sheet(AddSheetParameters(**input_data.model_dump()))
+ require_success(result, "Failed to add the sheet")
+ data = result.data or {}
+ return {
+ "status": "success",
+ "message": (
+ f"Added and activated {data.get('added')}; {data.get('count')} sheet(s)"
+ ),
+ **data,
+ "execution_time": result.execution_time,
+ }
+
+ @mcp.tool()
+ async def activate_sheet(input_data: ActivateSheetInput) -> dict[str, Any]:
+ """Make a sheet of the active drawing the active one, so new views and notes go on it.
+
+ Names ignore case; an unknown name fails with the sheets listed. Needs:
+ an open drawing. Changes: the active sheet only. Returns: the `sheets`
+ and `active`.
+
+ Args:
+ input_data: `name`.
+
+ Returns:
+ dict[str, Any]: The sheets after.
+ """
+ input_data = normalize_input(input_data, ActivateSheetInput)
+ require_capability(
+ adapter, "activate_sheet", "Active adapter can't change sheets"
+ )
+ result = await adapter.activate_sheet(input_data.name)
+ require_success(result, "Failed to activate the sheet")
+ data = result.data or {}
+ return {
+ "status": "success",
+ "message": f"Active sheet: {data.get('active')}",
+ **data,
+ "execution_time": result.execution_time,
+ }
+
+ return 3
diff --git a/src/solidworks_mcp/tools/error_classifier.py b/src/solidworks_mcp/tools/error_classifier.py
index b8f2754c..2fe834ba 100644
--- a/src/solidworks_mcp/tools/error_classifier.py
+++ b/src/solidworks_mcp/tools/error_classifier.py
@@ -345,6 +345,24 @@ def matches(self, message: str, hresult: int | None) -> bool:
),
patterns=(r"SolidWorks made no (fade|undercut|lead-in)",),
),
+ ErrorRule(
+ error_type=INVALID_INPUT,
+ hint=(
+ "Read the sheets with list_sheets; a new sheet needs a name not in "
+ "use, a format such as 'a3 - iso' and a scale such as '1:2'."
+ ),
+ patterns=(
+ r"No sheet named '",
+ r"has a sheet named '[^']*' already",
+ r"A new sheet needs a name",
+ r"projection must be 'first' or 'third'",
+ ),
+ ),
+ ErrorRule(
+ error_type="feature_not_built",
+ hint="SolidWorks refused the sheet; read the sheets with list_sheets and retry.",
+ patterns=(r"SolidWorks (added no sheet|did not activate sheet)",),
+ ),
ErrorRule(
error_type=INVALID_INPUT,
hint=(
diff --git a/src/solidworks_mcp/tools/support_levels.py b/src/solidworks_mcp/tools/support_levels.py
index ec4de662..2483d22a 100644
--- a/src/solidworks_mcp/tools/support_levels.py
+++ b/src/solidworks_mcp/tools/support_levels.py
@@ -361,6 +361,19 @@ def _deprecated(replacement: str | None) -> Support:
SupportLevel.BETA,
"new: checked on SolidWorks by a scratch run, not yet by a live demo.",
),
+ # Queue item 37: beta until the drawing-sheets live demo.
+ "activate_sheet": Support(
+ SupportLevel.BETA,
+ "new: checked on SolidWorks by a scratch run, not yet by a live demo.",
+ ),
+ "add_sheet": Support(
+ SupportLevel.BETA,
+ "new: checked on SolidWorks by a scratch run, not yet by a live demo.",
+ ),
+ "list_sheets": Support(
+ SupportLevel.BETA,
+ "new: checked on SolidWorks by a scratch run, not yet by a live demo.",
+ ),
"delete_feature": _STABLE,
"get_dimension": _STABLE,
"insert_component": _STABLE,
diff --git a/src/solidworks_mcp/tools/tool_hints.py b/src/solidworks_mcp/tools/tool_hints.py
index 04c17335..1630e658 100644
--- a/src/solidworks_mcp/tools/tool_hints.py
+++ b/src/solidworks_mcp/tools/tool_hints.py
@@ -208,6 +208,9 @@ def _discards(title: str) -> ToolHints:
"move_copy_body": _adds("Move/Copy Body"),
"delete_bodies": _discards("Delete/Keep Bodies"),
"scale_body": _adds("Scale Body"),
+ "list_sheets": _reads("List Sheets"),
+ "add_sheet": _adds("Add Sheet"),
+ "activate_sheet": _sets("Activate Sheet"),
"list_thread_sizes": _reads("List Thread Sizes"),
"create_thread": _adds("Create Thread"),
"set_appearance": _sets("Set Appearance"),
diff --git a/src/solidworks_mcp/tools/toolsets.py b/src/solidworks_mcp/tools/toolsets.py
index 9e4c166a..c25ee162 100644
--- a/src/solidworks_mcp/tools/toolsets.py
+++ b/src/solidworks_mcp/tools/toolsets.py
@@ -32,7 +32,9 @@
"server_admin",
}
),
- "drawing": frozenset({"drawing", "drawing_automation", "drawing_analysis"}),
+ "drawing": frozenset(
+ {"drawing", "drawing_automation", "drawing_analysis", "drawing_sheets"}
+ ),
"automation": frozenset({"macro_recording", "automation", "template_management"}),
"vba": frozenset({"vba_generation"}),
"docs": frozenset({"docs_discovery"}),
diff --git a/tests/integration/test_tool_descriptions.py b/tests/integration/test_tool_descriptions.py
index 0dcd0a0a..bfa00ed0 100644
--- a/tests/integration/test_tool_descriptions.py
+++ b/tests/integration/test_tool_descriptions.py
@@ -27,6 +27,7 @@
"drawing",
"drawing_analysis",
"drawing_automation",
+ "drawing_sheets",
"engineering_data",
"equations",
"export",
diff --git a/tests/live/test_live_sw_drawing_sheets.py b/tests/live/test_live_sw_drawing_sheets.py
new file mode 100644
index 00000000..45cb3700
--- /dev/null
+++ b/tests/live/test_live_sw_drawing_sheets.py
@@ -0,0 +1,133 @@
+"""Drawing sheets (queue item 37), checked on real SolidWorks.
+
+A drilled angle bracket and a drawing of it: an A3 format on Sheet1 and
+its front, top and right views; on purpose, a second sheet named "sheet1"
+is refused; a new A2 sheet "Details" at 2:1 becomes active and takes an
+isometric view; back to Sheet1. Each step lists the sheets: names, paper,
+scale, projection and which is active.
+
+Run with::
+
+ powershell -ExecutionPolicy Bypass -File tests\\scripts\\live_demo.ps1 `
+ -Test tests/live/test_live_sw_drawing_sheets.py::test_a_drawing_on_two_sheets
+
+Collected only with ``SOLIDWORKS_MCP_RUN_REAL_INTEGRATION=1`` on Windows.
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Any
+
+import pytest
+
+from tests.live.drawing_parts import saved_bracket
+from tests.live.evidence import evidence
+
+pytestmark = pytest.mark.asyncio
+
+
+async def _tools(adapter: Any) -> dict[str, Any]:
+ """The drawing, file and sheet tools; name -> fn."""
+ from fastmcp import FastMCP
+
+ from solidworks_mcp.tools.drawing import register_drawing_tools
+ from solidworks_mcp.tools.drawing_automation import (
+ register_drawing_automation_tools,
+ )
+ from solidworks_mcp.tools.drawing_sheets import register_drawing_sheet_tools
+ from solidworks_mcp.tools.file_management import register_file_management_tools
+ from solidworks_mcp.tools.modeling import register_modeling_tools
+ from solidworks_mcp.tools.sketching import register_sketching_tools
+
+ mcp = FastMCP("sheets-live")
+ for register in (
+ register_modeling_tools,
+ register_sketching_tools,
+ register_file_management_tools,
+ register_drawing_tools,
+ register_drawing_automation_tools,
+ register_drawing_sheet_tools,
+ ):
+ await register(mcp, adapter, {})
+ return {t.name: t.fn for t in await mcp.list_tools()}
+
+
+async def _ok(reply: dict[str, Any]) -> dict[str, Any]:
+ assert reply["status"] == "success", reply
+ return reply
+
+
+async def test_a_drawing_on_two_sheets(scratch: Any, tmp_path: Path) -> None:
+ """Sheet1 with three views, a 2:1 A2 Details sheet with an isometric."""
+ adapter = scratch.adapter
+ tools = await _tools(adapter)
+ part = await saved_bracket(scratch, tools, tmp_path / "sheets-bracket.SLDPRT")
+ await _ok(await tools["create_drawing"]({"name": "two-sheets"}))
+ await _ok(await tools["update_sheet_format"]({"sheet_format": "a3 - iso"}))
+ # First angle (ISO): the top view below the front, the right on its left;
+ # at 1:1, clear of the title block in the bottom right.
+ for view_type, x, y in (
+ ("front", 230, 200),
+ ("top", 230, 110),
+ ("right", 100, 200),
+ ):
+ await _ok(
+ await tools["create_drawing_view"](
+ {
+ "model_path": part,
+ "view_type": view_type,
+ "position_x": x,
+ "position_y": y,
+ }
+ )
+ )
+ # The first view sets the sheet's scale to SolidWorks's choice (2:1 for
+ # this bracket) until create_drawing_view keeps it; set it back to 1:1.
+ await _ok(await tools["set_sheet_scale"]({"numerator": 1, "denominator": 1}))
+ adapter._zoom_to_fit(adapter.currentModel)
+ first = await _ok(await tools["list_sheets"]())
+ evidence(
+ "Sheet1 on A3: the bracket's front, top and right views",
+ first["sheets"],
+ call="list_sheets()",
+ )
+ assert first["count"] == 1
+ assert first["sheets"][0]["scale"] == "1:1"
+
+ # On purpose: a name in use, in another case.
+ refused = await tools["add_sheet"]({"name": "sheet1"})
+ evidence("a second 'sheet1' is refused", refused)
+ assert refused["status"] == "error" and refused["error_type"] == "invalid_input"
+
+ call = {"name": "Details", "sheet_format": "a2 - iso", "scale": "2:1"}
+ added = await _ok(await tools["add_sheet"](call))
+ evidence(
+ "an A2 Details sheet at 2:1, now active",
+ added["sheets"],
+ call=f"add_sheet({call})",
+ )
+ details = next(s for s in added["sheets"] if s["name"] == "Details")
+ assert details["active"] is True
+ assert details["paper_mm"] == pytest.approx([594, 420])
+ assert details["scale"] == "2:1"
+
+ view = await _ok(
+ await tools["create_drawing_view"](
+ {
+ "model_path": part,
+ "view_type": "isometric",
+ "position_x": 297,
+ "position_y": 210,
+ }
+ )
+ )
+ adapter._zoom_to_fit(adapter.currentModel)
+ evidence("an isometric view of the bracket on Details", view.get("data") or view)
+
+ back = await _ok(await tools["activate_sheet"]({"name": "SHEET1"}))
+ adapter._zoom_to_fit(adapter.currentModel)
+ evidence(
+ "back on Sheet1", back["sheets"], call="activate_sheet({'name': 'SHEET1'})"
+ )
+ assert back["active"] == "Sheet1"
diff --git a/tests/solidworks_mcp/adapters/sheet_calls.py b/tests/solidworks_mcp/adapters/sheet_calls.py
new file mode 100644
index 00000000..005d4639
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/sheet_calls.py
@@ -0,0 +1,22 @@
+"""One call of each adapter method queue item 37 adds, shared by the layer tests."""
+
+from __future__ import annotations
+
+from typing import Any
+
+from solidworks_mcp.adapters.base import AddSheetParameters
+
+from .body_calls import recorder_for
+
+CALLS: list[tuple[str, tuple[Any, ...], dict[str, Any]]] = [
+ ("list_sheets", (), {}),
+ ("add_sheet", (AddSheetParameters(name="Details"),), {}),
+ ("activate_sheet", ("Sheet1",), {}),
+]
+
+IDS = [call[0] for call in CALLS]
+
+
+def recorder() -> Any:
+ """A mock adapter whose sheet methods record their arguments."""
+ return recorder_for(IDS)
diff --git a/tests/solidworks_mcp/adapters/solidworks/test_drawing_sheets.py b/tests/solidworks_mcp/adapters/solidworks/test_drawing_sheets.py
new file mode 100644
index 00000000..cd84ce5b
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/solidworks/test_drawing_sheets.py
@@ -0,0 +1,201 @@
+"""Drawing sheets on fake COM objects shaped like SolidWorks 2026's (queue item 37).
+
+Spec: tools/drawing-sheets. The calls are the ones the probe of 2026-11-28
+measured (design.md of the drawing-sheets change).
+"""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+from typing import Any
+
+import pytest
+
+from solidworks_mcp.adapters import sw_type_info
+from solidworks_mcp.adapters.base import (
+ AdapterResult,
+ AdapterResultStatus,
+ AddSheetParameters,
+)
+from solidworks_mcp.adapters.solidworks import drawing_sheets
+
+LETTER = (0.0, 13.0, 1.0, 1.0, 0.0, 0.2794, 0.2159, 1.0)
+
+
+class _Drawing:
+ """IDrawingDoc: sheets by name with their properties, one active."""
+
+ def __init__(self, accept: bool = True) -> None:
+ self.sheets: dict[str, tuple[float, ...]] = {"Sheet1": LETTER}
+ self.active = "Sheet1"
+ self.accept = accept
+ self.added: tuple[Any, ...] = ()
+
+ def GetSheetNames(self) -> tuple[str, ...]:
+ return tuple(self.sheets)
+
+ def _sheet(self, name: str) -> Any:
+ return SimpleNamespace(
+ GetName=lambda: name, GetProperties2=lambda: self.sheets[name]
+ )
+
+ def GetCurrentSheet(self) -> Any:
+ return self._sheet(self.active)
+
+ def Sheet(self, name: str) -> Any:
+ return self._sheet(name)
+
+ def NewSheet4(
+ self,
+ name: str,
+ code: int,
+ template: int,
+ s1: float,
+ s2: float,
+ first: bool,
+ path: str,
+ width: float,
+ height: float,
+ *rest: Any,
+ ) -> bool:
+ self.added = (name, code, template, s1, s2, first, path, width, height, *rest)
+ if self.accept:
+ self.sheets[name] = (
+ code,
+ template,
+ s1,
+ s2,
+ float(first),
+ width,
+ height,
+ 1.0,
+ )
+ self.active = name
+ return self.accept
+
+ def ActivateSheet(self, name: str) -> bool:
+ if self.accept:
+ self.active = name
+ return self.accept
+
+
+class _Harness(drawing_sheets.SolidWorksDrawingSheetsMixin):
+ def __init__(self, drawing: Any) -> None:
+ self.drawing = drawing
+
+ def _attempt(self, operation: Any, default: Any = None) -> Any:
+ try:
+ return operation()
+ except Exception:
+ return default
+
+ def _pack_drawing(self) -> Any:
+ return self.drawing
+
+ def _pack_format_path(self, sheet_format: str) -> str:
+ return f"C:/formats/{sheet_format}.slddrt"
+
+ def _pack_run(self, name: str, build: Any) -> AdapterResult[Any]:
+ try:
+ data = build()
+ except Exception as e: # mirrors PyWin32Adapter._handle_com_operation
+ return AdapterResult(
+ status=AdapterResultStatus.ERROR, error=f"Error in {name}: {e}"
+ )
+ return AdapterResult(status=AdapterResultStatus.SUCCESS, data=data)
+
+
+@pytest.fixture(autouse=True)
+def plain_com(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(sw_type_info, "flagged", lambda obj, *_: obj)
+
+
+@pytest.mark.asyncio
+async def test_list_sheets() -> None:
+ result = await _Harness(_Drawing()).list_sheets()
+
+ assert result.data == {
+ "sheets": [
+ {
+ "name": "Sheet1",
+ "active": True,
+ "paper_mm": [279.4, 215.9],
+ "scale": "1:1",
+ "projection": "third",
+ }
+ ],
+ "count": 1,
+ "active": "Sheet1",
+ }
+
+
+@pytest.mark.asyncio
+async def test_add_a_sheet_with_the_active_projection() -> None:
+ drawing = _Drawing()
+
+ result = await _Harness(drawing).add_sheet(
+ AddSheetParameters(name=" Details ", scale="1:2")
+ )
+
+ assert result.data["added"] == "Details"
+ assert result.data["active"] == "Details"
+ name, code, template, s1, s2, first, path, width, height = drawing.added[:9]
+ assert (name, code, template, s1, s2, first) == ("Details", 8, 12, 1.0, 2.0, False)
+ assert path == "C:/formats/a3 - iso.slddrt"
+ assert (width, height) == pytest.approx((0.42, 0.297))
+ assert drawing.added[9:] == ("Default", 0, 0, 0, 0, 0, 0)
+
+
+@pytest.mark.asyncio
+async def test_a_given_projection() -> None:
+ drawing = _Drawing()
+
+ await _Harness(drawing).add_sheet(
+ AddSheetParameters(name="D", sheet_format="a2 - iso", projection="first")
+ )
+
+ assert drawing.added[5] is True
+ assert drawing.added[1] == 9
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(
+ ("params", "accept", "words"),
+ [
+ (AddSheetParameters(name="sheet1"), True, "already"),
+ (AddSheetParameters(name="D", scale="big"), True, "scale 'big'"),
+ (
+ AddSheetParameters(name="D", sheet_format="letter"),
+ True,
+ "paper_size must be",
+ ),
+ (AddSheetParameters(name="D"), False, "SolidWorks added no sheet 'D'"),
+ ],
+)
+async def test_refused_sheets(
+ params: AddSheetParameters, accept: bool, words: str
+) -> None:
+ result = await _Harness(_Drawing(accept)).add_sheet(params)
+
+ assert words in str(result.error)
+
+
+@pytest.mark.asyncio
+async def test_activate_a_sheet() -> None:
+ drawing = _Drawing()
+ drawing.sheets["Details"] = LETTER
+
+ result = await _Harness(drawing).activate_sheet("DETAILS")
+
+ assert result.data["active"] == "Details"
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(
+ ("name", "accept", "words"),
+ [("Nope", True, "No sheet named 'Nope'"), ("Sheet1", False, "did not activate")],
+)
+async def test_activate_failures(name: str, accept: bool, words: str) -> None:
+ result = await _Harness(_Drawing(accept)).activate_sheet(name)
+
+ assert words in str(result.error)
diff --git a/tests/solidworks_mcp/adapters/test_base_sheets.py b/tests/solidworks_mcp/adapters/test_base_sheets.py
new file mode 100644
index 00000000..09620e7e
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/test_base_sheets.py
@@ -0,0 +1,20 @@
+"""The sheet methods (queue item 37) on the base adapter: none is implemented there."""
+
+from __future__ import annotations
+
+from typing import Any
+
+import pytest
+
+from .sheet_calls import CALLS, IDS
+from .test_base_part_features import _bare
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(("name", "args", "kwargs"), CALLS, ids=IDS)
+async def test_each_sheet_method_names_itself_as_missing(
+ name: str, args: tuple[Any, ...], kwargs: dict[str, Any]
+) -> None:
+ result = await getattr(_bare(), name)(*args, **kwargs)
+
+ assert result.error == f"{name} is not implemented by this adapter"
diff --git a/tests/solidworks_mcp/adapters/test_circuit_breaker_sheets.py b/tests/solidworks_mcp/adapters/test_circuit_breaker_sheets.py
new file mode 100644
index 00000000..f0cec79e
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/test_circuit_breaker_sheets.py
@@ -0,0 +1,25 @@
+"""The sheet methods (queue item 37) pass through the circuit breaker unchanged."""
+
+from __future__ import annotations
+
+from typing import Any
+
+import pytest
+
+from solidworks_mcp.adapters.circuit_breaker import CircuitBreakerAdapter
+
+from .sheet_calls import CALLS, IDS, recorder
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(("name", "args", "kwargs"), CALLS, ids=IDS)
+async def test_each_sheet_method_passes_through(
+ name: str, args: tuple[Any, ...], kwargs: dict[str, Any]
+) -> None:
+ result = await getattr(CircuitBreakerAdapter(adapter=recorder()), name)(
+ *args, **kwargs
+ )
+
+ received = result.data[name][0]
+ assert received[: len(args)] == args
+ assert all(value in received for value in kwargs.values())
diff --git a/tests/solidworks_mcp/adapters/test_connection_pool_sheets.py b/tests/solidworks_mcp/adapters/test_connection_pool_sheets.py
new file mode 100644
index 00000000..cda19a95
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/test_connection_pool_sheets.py
@@ -0,0 +1,28 @@
+"""The sheet methods (queue item 37) pass through the connection pool unchanged."""
+
+from __future__ import annotations
+
+from typing import Any
+
+import pytest
+
+from solidworks_mcp.adapters.connection_pool import ConnectionPoolAdapter
+
+from .sheet_calls import CALLS, IDS, recorder
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(("name", "args", "kwargs"), CALLS, ids=IDS)
+async def test_each_sheet_method_passes_through(
+ name: str, args: tuple[Any, ...], kwargs: dict[str, Any]
+) -> None:
+ pool = ConnectionPoolAdapter(adapter_factory=recorder, max_size=1)
+ await pool.connect()
+ try:
+ result = await getattr(pool, name)(*args, **kwargs)
+ finally:
+ await pool.disconnect()
+
+ received = result.data[name][0]
+ assert received[: len(args)] == args
+ assert all(value in received for value in kwargs.values())
diff --git a/tests/solidworks_mcp/adapters/test_mock_drawing_sheets.py b/tests/solidworks_mcp/adapters/test_mock_drawing_sheets.py
new file mode 100644
index 00000000..d6b3f626
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/test_mock_drawing_sheets.py
@@ -0,0 +1,84 @@
+"""The mock adapter's drawing sheets (queue item 37). Spec: tools/drawing-sheets."""
+
+from __future__ import annotations
+
+import pytest
+
+from solidworks_mcp.adapters.base import AddSheetParameters
+from solidworks_mcp.adapters.mock_adapter import MockSolidWorksAdapter
+
+
+async def _drawing() -> MockSolidWorksAdapter:
+ adapter = MockSolidWorksAdapter({})
+ await adapter.connect()
+ await adapter.create_drawing()
+ return adapter
+
+
+@pytest.mark.asyncio
+async def test_add_list_and_activate() -> None:
+ adapter = await _drawing()
+
+ first = await adapter.list_sheets()
+ added = await adapter.add_sheet(
+ AddSheetParameters(name="Details", sheet_format="a2 - iso", scale="2:1")
+ )
+ back = await adapter.activate_sheet("sheet1")
+
+ assert first.data["active"] == "Sheet1"
+ assert added.data["active"] == "Details"
+ assert added.data["sheets"][1] == {
+ "name": "Details",
+ "active": True,
+ "paper_mm": [594.0, 420.0],
+ "scale": "2:1",
+ "projection": "third",
+ }
+ assert back.data["active"] == "Sheet1"
+
+
+@pytest.mark.asyncio
+async def test_a_given_projection() -> None:
+ adapter = await _drawing()
+
+ added = await adapter.add_sheet(AddSheetParameters(name="D", projection="first"))
+
+ assert added.data["sheets"][1]["projection"] == "first"
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize(
+ ("params", "words"),
+ [
+ (AddSheetParameters(name="sheet1"), "already"),
+ (AddSheetParameters(name="D", scale="big"), "scale 'big'"),
+ ],
+)
+async def test_refused_sheets(params: AddSheetParameters, words: str) -> None:
+ adapter = await _drawing()
+
+ result = await adapter.add_sheet(params)
+
+ assert words in str(result.error)
+
+
+@pytest.mark.asyncio
+async def test_an_unknown_sheet() -> None:
+ result = await (await _drawing()).activate_sheet("Nope")
+
+ assert "No sheet named 'Nope'" in str(result.error)
+
+
+@pytest.mark.asyncio
+async def test_a_part_is_not_a_drawing() -> None:
+ adapter = MockSolidWorksAdapter({})
+ await adapter.connect()
+ await adapter.create_part()
+
+ results = [
+ await adapter.list_sheets(),
+ await adapter.add_sheet(AddSheetParameters(name="D")),
+ await adapter.activate_sheet("Sheet1"),
+ ]
+
+ assert all(not r.is_success for r in results)
diff --git a/tests/solidworks_mcp/adapters/test_sheet_rules.py b/tests/solidworks_mcp/adapters/test_sheet_rules.py
new file mode 100644
index 00000000..383edfce
--- /dev/null
+++ b/tests/solidworks_mcp/adapters/test_sheet_rules.py
@@ -0,0 +1,57 @@
+"""The rules for drawing sheets (queue item 37). Spec: tools/drawing-sheets."""
+
+from __future__ import annotations
+
+import pytest
+
+from solidworks_mcp.adapters import sheet_rules as rules
+from solidworks_mcp.exceptions import InputRefused
+
+
+def test_an_entry_from_the_sheet_properties() -> None:
+ props = (8.0, 12.0, 1.0, 2.0, 1.0, 0.42, 0.297, 1.0)
+
+ assert rules.sheet_entry("Details", props, True) == {
+ "name": "Details",
+ "active": True,
+ "paper_mm": [420.0, 297.0],
+ "scale": "1:2",
+ "projection": "first",
+ }
+
+
+def test_an_unreadable_sheet_gives_its_name_only() -> None:
+ assert rules.sheet_entry("Sheet1", None, False) == {
+ "name": "Sheet1",
+ "active": False,
+ }
+
+
+def test_a_sheet_found_ignoring_case() -> None:
+ assert rules.resolve_sheet(["Sheet1", "Details"], " details ") == "Details"
+
+
+def test_an_unknown_sheet_lists_them() -> None:
+ with pytest.raises(InputRefused, match="has Sheet1, Details"):
+ rules.resolve_sheet(["Sheet1", "Details"], "Nope")
+ with pytest.raises(InputRefused, match="has none"):
+ rules.resolve_sheet([], "Nope")
+
+
+@pytest.mark.parametrize(
+ ("name", "projection", "words"),
+ [
+ (" ", None, "needs a name"),
+ ("SHEET1", None, "has a sheet named 'SHEET1' already"),
+ ("Details", "second", "projection must be"),
+ ],
+)
+def test_bad_new_sheets_are_refused(
+ name: str, projection: str | None, words: str
+) -> None:
+ with pytest.raises(InputRefused, match=words):
+ rules.check_new_sheet(["Sheet1"], name, projection)
+
+
+def test_a_good_new_sheet_passes() -> None:
+ rules.check_new_sheet(["Sheet1"], "Details", "third")
diff --git a/tests/solidworks_mcp/tools/test_drawing_sheets.py b/tests/solidworks_mcp/tools/test_drawing_sheets.py
new file mode 100644
index 00000000..81a759cb
--- /dev/null
+++ b/tests/solidworks_mcp/tools/test_drawing_sheets.py
@@ -0,0 +1,69 @@
+"""The drawing sheet tools on the mock adapter (queue item 37).
+
+Spec: tools/drawing-sheets.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+import pytest
+from fastmcp import FastMCP
+from pydantic import ValidationError
+
+from solidworks_mcp.adapters.mock_adapter import MockSolidWorksAdapter
+from solidworks_mcp.tools.drawing_sheets import (
+ ActivateSheetInput,
+ AddSheetInput,
+ register_drawing_sheet_tools,
+)
+
+
+async def _tools(adapter: Any) -> dict[str, Any]:
+ mcp = FastMCP("sheets")
+ assert await register_drawing_sheet_tools(mcp, adapter, {}) == 3
+ return {t.name: t.fn for t in await mcp.list_tools()}
+
+
+@pytest.fixture
+async def drawing() -> MockSolidWorksAdapter:
+ adapter = MockSolidWorksAdapter({})
+ await adapter.connect()
+ await adapter.create_drawing()
+ return adapter
+
+
+@pytest.mark.asyncio
+async def test_two_sheets(drawing: MockSolidWorksAdapter) -> None:
+ tools = await _tools(drawing)
+
+ listed = await tools["list_sheets"]()
+ added = await tools["add_sheet"](AddSheetInput(name="Details", scale="2:1"))
+ back = await tools["activate_sheet"](ActivateSheetInput(name="Sheet1"))
+
+ assert listed["message"] == "1 sheet(s); active: Sheet1"
+ assert added["message"] == "Added and activated Details; 2 sheet(s)"
+ assert back["message"] == "Active sheet: Sheet1"
+
+
+@pytest.mark.asyncio
+async def test_an_unknown_sheet_is_an_error_reply(
+ drawing: MockSolidWorksAdapter,
+) -> None:
+ reply = await (await _tools(drawing))["activate_sheet"]({"name": "Nope"})
+
+ assert reply["status"] == "error"
+ assert reply["error_type"] == "invalid_input"
+
+
+@pytest.mark.parametrize(
+ "values",
+ [
+ {"name": ""},
+ {"name": "D", "paper_size": "letter"},
+ {"name": "D", "projection": "x"},
+ ],
+)
+def test_inputs_are_strict(values: dict[str, Any]) -> None:
+ with pytest.raises(ValidationError):
+ AddSheetInput(**values)
diff --git a/tests/solidworks_mcp/tools/test_error_classifier.py b/tests/solidworks_mcp/tools/test_error_classifier.py
index d2958a1a..dde23976 100644
--- a/tests/solidworks_mcp/tools/test_error_classifier.py
+++ b/tests/solidworks_mcp/tools/test_error_classifier.py
@@ -90,6 +90,12 @@ def classifier() -> ErrorClassifier:
"feature_not_built",
),
("No body named 'Nope'. Bodies in the part: Block.", "invalid_input"),
+ ("No sheet named 'Nope'; the drawing has Sheet1.", "invalid_input"),
+ ("The drawing has a sheet named 'D' already; its sheets", "invalid_input"),
+ ("A new sheet needs a name.", "invalid_input"),
+ ("projection must be 'first' or 'third'.", "invalid_input"),
+ ("SolidWorks added no sheet 'D'.", "feature_not_built"),
+ ("SolidWorks did not activate sheet 'D'.", "feature_not_built"),
("No thread size 'M7x1.0' in the profile; nearest: M6x1.0", "invalid_input"),
("No edge at [1, 2, 3] mm; give a point on the circular edge", "invalid_input"),
("The edge at [1] mm is not a circle; a thread starts", "invalid_input"),