SldFile 0.1.0-alpha
dotnet add package SldFile --version 0.1.0-alpha
NuGet\Install-Package SldFile -Version 0.1.0-alpha
<PackageReference Include="SldFile" Version="0.1.0-alpha" />
<PackageVersion Include="SldFile" Version="0.1.0-alpha" />
<PackageReference Include="SldFile" />
paket add SldFile --version 0.1.0-alpha
#r "nuget: SldFile, 0.1.0-alpha"
#:package SldFile@0.1.0-alpha
#addin nuget:?package=SldFile&version=0.1.0-alpha&prerelease
#tool nuget:?package=SldFile&version=0.1.0-alpha&prerelease
SldFile
English | 简体中文
Work in Progress: SldFile is currently under active development. Compatibility testing across different SolidWorks versions and complex documents is still limited. If you encounter unsupported or incompatible files, please feel free to open an issue (ideally with sample models or diagnostic logs) to help us improve compatibility!
SldFile is a pure .NET library designed to inspect, read, and edit SolidWorks files (.sldprt, .sldasm, .slddrw) and sketch templates (.ske) offline—completely independent of SolidWorks installations or Windows COM interop.
Targeting .NET Standard 2.0, SldFile runs seamlessly across Windows, Linux, and macOS runtimes (.NET Core, .NET 5/6/7/8/9+, and .NET Framework 4.6.1+).
Features
- No SolidWorks Required: 100% managed C# implementation. Runs on headless servers, containers (Docker), Linux, macOS, and Windows with zero external CAD dependencies.
- Full Document Format Support:
- Parts (
.sldprt) - Assemblies (
.sldasm) - Drawings (
.slddrw) - Sketch Feature Templates (
.ske) - Supports both legacy OLE Compound File (CFB) and modern section-archive containers.
- Parts (
- Metadata & Properties Editing:
- Read and update standard document metadata: Title, Subject, Author, Keywords, Comments, Company, Manager, Category, Last Saved By.
- Read and edit document-level custom properties and configuration-specific properties.
- Strongly-typed values:
string,int,double,bool, andDateTime.
- Non-Destructive Saving:
- Saves only the modified metadata and properties.
- Preserves untouched streams, geometry, and internal data structures byte-by-byte.
- Assembly & BOM Extraction:
- Inspect full component hierarchy trees with configuration details and transform matrices.
- Automatically aggregate and compute Bill of Materials (BOM) with quantities and part numbers.
- Read embedded virtual component documents.
- 3D Geometry & Mesh Export:
- Extract and export raw Parasolid binary transmit data (
.x_b) per configuration. - Decode 3D display tessellation meshes (vertices, normals, triangle indices, outlines).
- Export meshes directly to Wavefront OBJ (
.obj) and binary STL (.stl).
- Extract and export raw Parasolid binary transmit data (
- 2D Drawing Sheets & Views:
- Retrieve drawing sheets, drawing view hierarchies, and referenced model paths/configurations.
- Extract per-sheet PNG preview images.
- Sketches & Feature Templates:
- Extract sketch entities: points, segments (lines, arcs, circles, splines), relations, and dimensions.
- Inspect, rename dimension/parameter definitions, and save sketch templates (
.ske).
- Visuals & Inspection:
- Extract high-resolution PNG and standard BMP preview images.
- Access external file references, user history, revision logs, and FeatureManager feature lists.
Installation
Install via the .NET CLI:
dotnet add package SldFile
Or via the Package Manager Console:
Install-Package SldFile
Or add the package reference to your .csproj:
<PackageReference Include="SldFile" Version="1.0.0" />
How to Use
Opening and Saving Documents
Documents are opened in read-only mode by default to prevent accidental modifications. Pass readOnly: false when you plan to edit and save.
using SldFile;
// Read-only mode (default)
using var doc = SwFile.Open("bracket.sldprt");
// Edit mode
using var editableDoc = SwFile.Open("bracket.sldprt", readOnly: false);
// ... make modifications ...
editableDoc.Save(); // Persists changes to disk
Detailed Usage Guide
For comprehensive code examples and in-depth usage, please refer to the Detailed Usage Guide:
- 1. Reading and Editing Document Metadata: Title, Author, Subject, Keywords, Comments, Company, etc.
- 2. Custom Properties and Configuration Properties: Typed property values (
string,int,double,bool,DateTime) across configurations. - 3. Extracting Preview Images: High-resolution PNG and standard BMP thumbnails.
- 4. Assembly Hierarchy and Bill of Materials (BOM): Component trees, transforms, virtual components, and aggregated BOM lists.
- 5. 3D Geometry: Parasolid and Mesh Export: Export Parasolid (
.x_b) and 3D display meshes to OBJ and STL. - 6. 2D Drawing Inspection: Drawing sheets, views, referenced models, and per-sheet preview PNGs.
- 7. Inspecting Sketches: 3D/2D sketch points, lines, arcs, splines, relations, and dimensions.
- 8. Working with Sketch Templates (.ske): Read and rename dimensions/parameters in feature templates.
- 9. Document Inspection: External references, FeatureManager tree features, users, and revision logs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- OpenMcdf (>= 3.1.4)
- System.Memory (>= 4.6.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha | 65 | 10/29/2026 |