sw-api-patterns

Installation
SKILL.md

SolidWorks API Patterns

Getting Active Document

var swApp = (ISldWorks)Application;
var model = swApp.ActiveDoc as IModelDoc2;
if (model == null) return; // Always null-check

Traversing Features

var feat = model.FirstFeature() as IFeature;
while (feat != null)
{
    // Process feature...
    feat = feat.GetNextFeature() as IFeature;
}
Installs
4
GitHub Stars
1
First Seen
Feb 19, 2026
sw-api-patterns — ttsmith21/swcsharpaddin