solidworks-automation-skill  by wzyn20051216

Python toolkit for automating SolidWorks CAD operations

Created 2 months ago
329 stars

Top 83.1% on SourcePulse

GitHubView on GitHub
Project Summary

This Python toolkit automates SolidWorks through its COM API, targeting engineers, researchers, and AI agents (like Codex, Claude, OpenClaw) needing programmatic control over CAD workflows. It offers a comprehensive solution for automating part modeling, assembly, drawing creation, file export, and simulation, significantly streamlining complex design tasks.

How It Works

The toolkit utilizes Python's pywin32 and comtypes libraries to interface directly with the SolidWorks Component Object Model (COM) API. This allows for granular control over SolidWorks functionalities, enabling scripted operations across the entire product lifecycle. A key design principle is the "Verified API Workflow," which prioritizes consulting official SolidWorks API documentation before implementing wrappers for less common or undocumented functions, ensuring robustness and accuracy.

Quick Start & Requirements

  • Requirements: Windows 10/11, SolidWorks 2020-2025 (any version), Python 3.8+, pywin32, comtypes.
  • Installation:
    • Recommended for agents: npx github:wzyn20051216/solidworks-automation-skill
    • Manual: git clone the repository, pip install "pywin32>=305" "comtypes>=1.2.0", then run python scripts/sw_preflight.py.
  • Links: The repository serves as the primary documentation source.

Highlighted Details

  • Full-Cycle Automation: Supports part modeling (sketching, extrude, fillet, patterns), assembly operations (components, mates, interference), drawing creation (views, BOM), and extensive file export formats (STEP, STL, IGES, PDF, DXF/DWG, Parasolid).
  • Advanced Capabilities: Includes features for sheet metal design, weldments, FEA simulation (static, frequency, thermal analysis), appearance/material control, custom properties, and configuration management.
  • CAD Agent Self-Review: Automates the generation of multi-view previews, JSON reports, and Markdown summaries to aid AI agents in validating model designs against intent.
  • API Lookup Workflow: Encourages and facilitates the process of looking up official API documentation for unwrapped functions, promoting reliable integration.

Maintenance & Community

The provided README does not detail specific contributors, sponsorships, or community channels (e.g., Discord, Slack).

Licensing & Compatibility

This project is licensed under the MIT License, which is permissive and generally compatible with commercial use and closed-source applications.

Limitations & Caveats

The toolkit is strictly limited to Windows operating systems due to its reliance on SolidWorks and the Windows COM API. A valid, installed version of SolidWorks (2020-2025) is a prerequisite for operation. Automation of SolidWorks APIs not explicitly wrapped by the toolkit may require manual investigation using official SolidWorks documentation.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
4
Star History
256 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.