Przejdź do treści
Biblioteka skilli
Projektowanie i UX · Budowanie i kod

solidworks

/solidworks

Pracuje z SOLIDWORKS: buduje i sprawdza części, złożenia i rysunki przez API, uruchamia analizy FEA i ruchu oraz prowadzi krok po kroku po interfejsie.

Licencja
MIT
Ostatnia zmiana repozytorium
07.11.2026

Ocena i bezpieczeństwo

98/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena13 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
14
Skrypty
7
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 7 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/SwKit.cs, scripts/SwMotion.cs, scripts/SwSim.cs, scripts/recipes/inspect_model.cs, scripts/recipes/selftest.cs, scripts/recipes/status.cs, scripts/swrun.ps1

Co robi i kiedy

Pracuje z SOLIDWORKS: buduje i sprawdza części, złożenia i rysunki przez API, uruchamia analizy FEA i ruchu oraz prowadzi krok po kroku po interfejsie.

Wyzwalacze z opisu

model this\
Oryginalny opis (EN)

Work with SOLIDWORKS end to end: drive it directly on Windows through its API to build and inspect parts, assemblies and drawings, run Simulation FEA and Motion studies, and export data, or guide a person step by step through the interface. Use this whenever the user mentions SOLIDWORKS, SolidWorks, .SLDPRT, .SLDASM or .SLDDRW files, sketches, mates, design tables, configurations, FEA, von Mises stress, factor of safety, mesh convergence, Motion Analysis, rotary motors, contact, or mechanical CAD work such as a clutch, gearbox or bracket, even if they only say \"model this\", \"check this part

Jak działa

  1. Rules that protect the user's work
  2. Rules that protect the results
  3. How to run code
  4. Versions and licences
  5. Ready-made recipes
  6. Where to look next
  7. When something fails
Sekcje z nagłówków SKILL.md, w oryginale · 105 linii, 1 058 słów
Podgląd SKILL.md
---
name: solidworks
description: "Work with SOLIDWORKS end to end: drive it directly on Windows through its API to build and inspect parts, assemblies and drawings, run Simulation FEA and Motion studies, and export data, or guide a person step by step through the interface. Use this whenever the user mentions SOLIDWORKS, SolidWorks, .SLDPRT, .SLDASM or .SLDDRW files, sketches, mates, design tables, configurations, FEA, von Mises stress, factor of safety, mesh convergence, Motion Analysis, rotary motors, contact, or mechanical CAD work such as a clutch, gearbox or bracket, even if they only say \"model this\", \"check this part\" or \"why won't this mate\"."
---

# SOLIDWORKS

Two ways to help, and most requests need one of them:

- **Drive it.** If SOLIDWORKS is installed on this Windows machine, it can be fully controlled from compiled C#. Use this when the user wants something built, measured, simulated or exported.
- **Guide it.** Use `references/gui-guide.md` when the user wants to learn, is doing the clicking, or is working on a computer you cannot reach.

Ask only if the request could go either way and it changes the work. "Model a hub" means drive. "How do I add a rotary motor?" means guide.

## Rules that protect the user's work

1. **Run `status.cs` first.** It lists every open document and whether it has unsaved changes. The user may be working in the same session.
2. **Work on copies.** Copy source files to a scratch folder before opening them. Save results under new names. Opening and saving an old file upgrades it, and that cannot be undone: a file saved in a newer version will not open in an older one.
3. **Close only what you opened**, by title with `CloseDoc`. Never use `CloseAllDocuments`, because it can discard the user's unsaved work. Only call `ExitApp` if you started SOLIDWORKS and `status.cs` shows nothing but your own files.
4. **Restore settings you change.** `Kit.NoDimPopup` does this for the dimension popup. Follow that pattern for any other preference.
5. **Never write a licence key or activation code** into a file, script or reply, even if you find one in the project.

## Rules that protect the results

SOLIDWORKS reports success on wrong answers. In testing, a load was applied a million times too small with no error, and a drawing came out in inches with no warning. So:

- **Check every result against a hand calculation** before reporting it. If you cannot estimate the answer, say so.
- **Prove a check can fail.** Zero interferences means nothing until a deliberate overlap has been detected. See `selftest.cs` for the pattern.
- **Read values back after setting them.** A property that accepts a value may not have used it.
- **Look at output.** Save drawings as PNG and read the image. File size and return codes do not show inches, missing title blocks or empty views.
- **Never report a number from a run that failed partway.** Say which step failed and what the error was.

Report a result with its hand value and the difference, for example "0.00486 mm against 0.00488 mm by hand, 0.3% low".

## How to run code

Write a recipe as a `.cs` file with the Write tool, not a shell heredoc, because C# strings break shell quoting. Use a scratch folder for recipes and output, and full paths everywhere. Then run it with the PowerShell tool:

```powershell
$s = "<base directory of this skill>\scripts"
powershell -NoProfile -ExecutionPolicy Bypass -File "$s\swrun.ps1" -Source "C:\full\path\recipe.cs" -Args2 "C:\full\path\work"
```

The base directory is shown when this skill loads. Add `-Sim` for FEA and `-Motion` for Motion. They compile in `SwSim.cs` and `SwMotion.cs`. Use a timeout of at least 5 minutes: SOLIDWORKS takes about a minute to start, and a study takes longer.

A minimal recipe:

```csharp
using System;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;

class Recipe
{
    static void Main(string[] a)
    {
        var sw = Kit.Connect();
        var p = Kit.NewPart();                         // forced to MMGS
        var sk = Kit.Sketch(p, "Front Plane", sm => sm.CreateCircleByRadius(0, 0, 0, 30 * Kit.MM));
        Kit.Extrude(p, sk, 12 * Kit.MM);
        Console.WriteLine(Kit.VolMm3(p));              // check against pi r2 h
        Kit.Check(p, "disc");
        Kit.Save(p, System.IO.Path.Combine(a[0], "Disc.SLDPRT"));
        sw.CloseDoc(p.GetTitle());
    }
}
```

Three API facts catch almost everyone: lengths are **metres**, angles are **radians**, and `AddMate5` returns error code **1 for success**.

## Versions and licences

The kit was tested on SOLIDWORKS 2023 SP5, English install. It finds other years automatically, but behaviour can change between releases, so run `selftest.cs` once before trusting it on another version, and tell the user about any failures. Simulation and Motion need a licence that includes them. Premium has both. If one is missing, the self-test stops at that stage and the earlier results still stand.

## Ready-made recipes

| Recipe in `scripts/recipes/` | Use |
|---|---|
| `status.cs` | Version, licence, open documents. Read-only. Run first. |
| `inspect_model.cs <path>` | Mass, centre of mass, configurations, features, material, rebuild state. |
| `selftest.cs <empty folder>` (`-Sim -Motion`) | Builds small models and checks 19 results against hand values. Run after any SOLIDWORKS upgrade, or on a new machine, before trusting the kit. Also the best worked example of everything. |

## Where to look next

Read only the file the task needs.

| Task | Read |
|---|---|
| Sketches, features, patterns, fillets, materials, equations, configurations | `references/api-modelling.md` |
| Assemblies, mates, interference, drawings, exports | `references/api-assembly-drawing.md` |
| FEA: loads, mesh, stress results, factor of safety | `references/api-simulation.md` |
| Motion: motors, springs, contact, plots, CSV | `references/api-motion.md` |
| Teaching someone through the interface | `references/gui-guide.md` |
| Centrifugal clutch design, sizing and checks | `references/clutch-design.md` |

Each `api-*` file marks what has actually been run. If a feature is marked not tested, or is not listed, try it on a scratch model, check the result by hand, and tell the user it is new ground. Exact signatures can be read from `api\redist\SolidWorks.Interop.*.dll` in the install folder by reflection, which is faster and safer than guessing argument order. Help files are in `api\` too.

## When something fails

| Symptom | Cause and fix |
|---|---|
| `OpenDoc6` error 2 | Relative path. SOLIDWORKS resolves it from its own folder. Use a full path. |
| Feature call returns null | Nothing selected, or wrong direction. Check the selection, then see `Kit.CutThrough`. |
| Feature named `Cut-Extrude2` when you expected 1 | A failed call used up the number. Keep the returned `Feature` object and never assume a name. |
| `0x80010105` `RPC_E_SERVERFAULT` | SOLIDWORKS rejected the call. List documents to see what is left open. `ToolsCheckInterference2` and a second `GetAddInObject` both do this, and each has a replacement in the references. |
| `Environment` is ambiguous | Write `System.Environment`, because the interop has its own type of that name. |
| `dynamic` errors on a `GetModelDoc2()` result | Cast it: `(ModelDoc2)c.GetModelDoc2()`. |
| Dialog appears to hang the run | Open with `swOpenDocOptions_Silent` and tell the user a popup may need clicking. |
Pliki w paczce (14)
  • SKILL.md 7 KB
  • references/api-assembly-drawing.md 5 KB
  • references/api-modelling.md 5 KB
  • references/api-motion.md 4 KB
  • references/api-simulation.md 5 KB
  • references/clutch-design.md 3 KB
  • references/gui-guide.md 5 KB
  • scripts/SwKit.cs 9 KB
  • scripts/SwMotion.cs 5 KB
  • scripts/SwSim.cs 5 KB
  • scripts/swrun.ps1 2 KB
  • scripts/recipes/inspect_model.cs 2 KB
  • scripts/recipes/selftest.cs 10 KB
  • scripts/recipes/status.cs 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · NotCodingRN/solidworks-skill98MIT
poly-gents/syncolab-skills90Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki b557fbc8fc3e (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95cad-operations
    Tworzy, edytuje, sprawdza i eksportuje dokumenty CAD: DWG, DXF, PDF, SVG, STEP i pliki SolidWorks oraz FreeCAD lokalnie.
  • 95cad-operations
    Tworzy, edytuje i eksportuje dokumenty CAD: DWG, DXF, STEP, STL, schematy jednokreskowe i konstrukcje nawierzchni, z lokalnymi narzędziami.
  • 98swnx-switch
    Czyta dane części z plików SolidWorks i Siemens NX, konwertuje je w obie strony z kontrolą tolerancji i porównuje, czy to ta sama część.
  • 100webots-simulation
    Prowadzi symulacje robotów w Webots, zbiera dowody kolizji i przenosi problemy na złożenie w SolidWorks.
  • 100solidworks-com-modeling
    Buduje części SolidWorks z kodu na Windows przez COM, z szkicami, wyciągnięciami, eksportami STEP i STL oraz obsługą pułapek API.
  • 100solidworks-draw
    Buduje parametryczne modele części maszynowych w SolidWorks na podstawie opisu w języku naturalnym, na przykład wałów, tarcz i tłoków.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.