Swpilotcli sketch draw

From arthurle3210/SwpilotCLI · View interactive version

Swpilotcli sketch draw is an AI agent skill from the GitHub repository arthurle3210/SwpilotCLI. Draw sketch geometry in the active SolidWorks sketch from a JSON SketchPlan. Supports line, circle, arc, ellipse. Auto-infers H/V on lines and COINCIDENT on shared endpoints. Applies anchor, explicit relations, and dimensions. Does NOT exit the sketch. Call swpilotcli-sketch-exit only when explicitl

How to use this skill

Skill file

swpilotcli-sketch-draw

Draw sketch entities from a JSON SketchPlan. The sketch must already be open (active) before running this tool.

Prerequisites

What this Skill does

  1. Reads a JSON SketchPlan from stdin or a file argument
  2. Creates entities (line, circle, arc, ellipse)
  3. Auto-infers H/V relations on lines and COINCIDENT on shared endpoints
  4. Applies anchor (COINCIDENT to origin)
  5. Applies explicit relations (tangent, parallel, equal, etc.)
  6. Applies dimensions
  7. Stays in sketch — does not call EditRebuild3

Quick start

echo '{"entities":[...],"anchor":{...},"relations":[...],"dimensions":[...]}' | dotnet run --project ./sup_tools/swpilotcli-sketch-draw/scripts/SketchDraw/SketchDraw.csproj

Or pass a JSON file:

dotnet run --project ./sup_tools/swpilotcli-sketch-draw/scripts/SketchDraw/SketchDraw.csproj plan.json

JSON SketchPlan Schema

All coordinates and sizes are in mm. The tool converts to meters internally.

Entity types

line

{ "id": "L1", "type": "line", "start": [x1, y1], "end": [x2, y2], "construction": false }

circle

{ "id": "C1", "type": "circle", "center": [cx, cy], "radius": r }

arc (3-point: start → end, passing through)

{ "id": "A1", "type": "arc", "start": [x1, y1], "end": [x2, y2], "through": [xm, ym] }

ellipse

{ "id": "E1", "type": "ellipse", "center": [cx, cy], "semi_major": a, "semi_minor": b, "orientation": "horizontal" }

Anchor

{ "ref": "L1.start", "to": "origin" }

Relations

{ "type": "tangent",       "refs": ["A1", "L1"] }
{ "type": "parallel",      "refs": ["L1", "L2"] }
{ "type": "perpendicular", "refs": ["L1", "L2"] }
{ "type": "equal",         "refs": ["L1", "L2"] }
{ "type": "concentric",    "refs": ["C1", "C2"] }
{ "type": "coincident",    "refs": ["L1.end", "L2.start"] }
{ "type": "horizontal",    "refs": ["L1"] }
{ "type": "vertical",      "refs": ["L1"] }
{ "type": "horizontal",    "refs": ["P1.start", "P2.start"] }
{ "type": "collinear",     "refs": ["L1", "L2"] }
{ "type": "symmetric",     "refs": ["L1.start", "L2.start", "L3"] }
{ "type": "fixed",         "refs": ["L1.start"] }

Dimensions

{ "ref":  "L1",          "type": "length",     "value": 50 }
{ "ref":  "C1",          "type": "radius",     "value": 10 }
{ "ref":  "A1",          "type": "radius",     "value": 10 }
{ "ref":  "E1",          "type": "semi_major", "value": 40 }
{ "ref":  "E1",          "type": "semi_minor", "value": 25 }
{ "refs": ["L1", "L2"],  "type": "distance",   "value": 50, "label": [0, -40] }
{ "refs": ["L1", "L2"],  "type": "angle",      "value": 90, "label": [20, 20] }

Auto-infer rules

Example

{
  "entities": [
    { "id": "L1", "type": "line", "start": [0, 0], "end": [50, 0] }
  ],
  "anchor": { "ref": "L1.start", "to": "origin" },
  "dimensions": [
    { "ref": "L1", "type": "length", "value": 50 }
  ]
}

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.