SldFile 0.1.0-alpha

This is a prerelease version of SldFile.
dotnet add package SldFile --version 0.1.0-alpha
                    
NuGet\Install-Package SldFile -Version 0.1.0-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SldFile" Version="0.1.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SldFile" Version="0.1.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="SldFile" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SldFile --version 0.1.0-alpha
                    
#r "nuget: SldFile, 0.1.0-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SldFile@0.1.0-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SldFile&version=0.1.0-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SldFile&version=0.1.0-alpha&prerelease
                    
Install as a Cake Tool

SldFile — Read SolidWorks files directly from code

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+).

SldFile Viewer


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.
  • 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, and DateTime.
  • 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).
  • 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:

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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