Solidworks .sldprt file format

Skip to first unread message

Bryan Bishop

Jan 12, 2010, 12:21:40 PM1/12/10
to Open Manufacturing,
Hey all,

I've been looking at the .sldprt file format off-and-on for a few
months now. I thought I'd share some notes on what it is and how to
get the data out of it.
"SolidWorks files use the Microsoft Structured storage file format.
This means that there are various files embedded within each SLDDRW,
SLDPRT, SLDASM file, including preview bitmaps and metadata sub-files.
Various third-party tools (see Structured storage) can be used to
extract these sub-files, although the subfiles in many cases use
proprietary binary file formats."

COM structured storage
OLE structured storage

So, on debian, if you wanted to make preview images for thumbnails in
a file browser for .sldprt, .sldasm, and .slddrw files, you can do
something like this:

sudo apt-get install libgsf-bin
gsf cat mydrawingfile.SLDDRW PreviewPNG > preview.png && eog preview.png

You can also use the gsf tool to extract the "display list", which is
where the juicy information on the model is. I haven't been able to
figure that out yet. It usually has a name like
Contents/DisplayLists__ZLB and presumably ZLB is some sort of format,
extension, etc. To see an overview of all the sections of the .sldprt
file, you can run "gsf list blah.sldprt" and hack away.

On windows, you can use the win32com library in python to access
Solidworks and convert to 3dxml (or any other format) like so:

import win32com.client
doc=app.OpenDoc("c:\\Testpart.SLDPRT", 1)
doc.SaveAs2("c:\\Testpart.3dxml", 0, True, False)

Some good that does for the linux folks. Not sure how to run that
under wine successfully. I remember reading about a way to load up
DLLs into python, but this is again Windows only, but I don't see any
particular reason why wine couldn't be used in there somewhere to
facilitate python using a DLL while running under linux.

As a resource to help break the file format, I made a series of files
that started off with nothing, and moved up to basic primitive
geometries, and eventually 3D extruded shapes and so on. At each step,
I was using Solidworks to save the file in as many formats as I could
imagine. You can find the archive on the web here: (8.4 MB)

Helpful links:

- Bryan
1 512 203 0507

Mike Slouka

Aug 21, 2015, 3:24:18 PM8/21/15
to Open Manufacturing,

It's 5 years later. Have you gotten any farther on this?
What was your goal?
My goal is to edit the sldprt file and update features, parameters and such then save the file.
Later I want to be able to open it in edrawing or solidworks.

Currently I open the file in Solidworks, and through VbScript and other means I update features and parameters.
The problem is that it is too slow. It takes about 60-90 seconds to complete. I want to do it in under 5 seconds.


Bryan Bishop

Aug 21, 2015, 3:25:36 PM8/21/15
to Mike Slouka, Bryan Bishop, Open Manufacturing
On Fri, Aug 21, 2015 at 2:21 PM, Mike Slouka <> wrote:
It's 5 years later. Have you gotten any farther on this?

Nope, I haven't looked into this since then. I also don't know anyone who is currently trying. In the mean time I suggest looking at verbnurbs or solvespace as possibly-usable alternatives to SolidWorks. I would be happy to take this up in the future, but at the moment I have no pressing need to know the file format for SolidWorks models...

Oct 14, 2015, 3:49:30 PM10/14/15
to Open Manufacturing,,
Hey Bryan, 
   I've been working on this, too. Your design files link in the original post seems broken. Is it possible for you to reupload or maybe send me an email with these files? They'll be a huge step ahead for me in this direction. 


Bryan Bishop

Oct 14, 2015, 3:50:26 PM10/14/15
to, Bryan Bishop, Open Manufacturing, Mike Slouka
On Wed, Oct 14, 2015 at 2:47 PM, <> wrote:
> Your design files link in the original post seems broken

Oct 14, 2015, 3:55:29 PM10/14/15
to Open Manufacturing,,,
That was quick. Thanks! Will post updates to this thread. 

Yilong Fan

Nov 21, 2018, 7:41:57 PM11/21/18
to Open Manufacturing
Hi Mike

How did your project go?

I am looking into this because I want to get a hash of a file to check whether a file has been updated.

But the hash changes every time you save it.

I assume there might be a timestamp inside the file, therefore I was looking into unpacking the file and only hashing the 3d model.

In regards to your project, you can run solidworks without solidworks showing, because solidworks does not have to work out display, it would be quicker that way.

Reply all
Reply to author
0 new messages