SolidWorks List Features
Print the active document's Feature Tree as [TypeName] Name lines.
Prerequisites
- SolidWorks 2024+ with SwpilotCLI add-in installed
- .NET 8+ Runtime
- An active SolidWorks document
What this Skill does
- Walks the feature tree starting from
swDoc.FirstFeature(), advancing withGetNextFeature() - Prints each feature as
[<TypeName>] <FeatureName>where TypeName comes fromFeature.GetTypeName2() - Optionally stops after N features if an integer is passed as the first argument
When to use
- Find the name of a reference plane before selecting it (e.g.
Front Plane,Right Plane, or customPlane1) - Check whether a specific feature exists / verify order
- Inspect feature structure before
move-rollback-bar, deletion, or debugging
Quick start
# List all features
dotnet run --project ./sup_tools/swpilotcli-list-features/scripts/ListFeatures/ListFeatures.csproj
# List only the first 20 features
dotnet run --project ./sup_tools/swpilotcli-list-features/scripts/ListFeatures/ListFeatures.csproj -- 20
Return codes
| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | General error |
| 2 | Cannot connect to SolidWorks |
| 3 | No active document |