solidworks_mcp.progress.snapshot¶
solidworks_mcp.progress.snapshot ¶
Refresh the committed type-library snapshot (Windows, SolidWorks installed).
Run after a SolidWorks upgrade, then regenerate the progress files::
python -m solidworks_mcp.progress.snapshot
python -m solidworks_mcp.progress.generate
It reads the pywin32 gen_py wrapper of sldworks.tlb; SolidWorks itself
doesn't need to be running.
Attributes¶
Classes¶
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
Functions:¶
main ¶
Write the snapshot under root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path | None
|
The repository root; the current directory when omitted. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
The file written. |
Source code in src/solidworks_mcp/progress/snapshot.py
take_snapshot ¶
Read the installed type library's interface and method names.
Returns:
| Name | Type | Description |
|---|---|---|
Snapshot |
Snapshot
|
The names, with the wrapper's module name as its source. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the gen_py wrapper isn't available. |