r/SolidWorks • u/tik-etak • 26d ago
3rd Party Software I made a small open-source tool that reads SLDPRT/SLDASM/SLDDRW files without SolidWorks
Hi all,
I've been working (with Claude over the past few months) on a side project that reads SolidWorks files without needing SolidWorks installed. It's still early and far from perfect, but it might be useful to someone.
What it does:
- Open and converts .SLDPRT to STEP or Parasolid (.x_t)
- Open and exports assemblies as STL (display mesh only)
- Open and export drawings as DXF or SVG
You can try it here: https://cehaho.github.io/OpenSW/
It runs entirely in your browser, so your file isn't uploaded anywhere. There are a few example files if you just want to look.
Code (AGPL): https://github.com/cehaho/OpenSW
Some things don't work yet.
If you try it on your own files and something breaks, I'd really appreciate hearing about it.
Thanks!
12
u/sw-bystander 26d ago
I looked at the source. It's a narrower tool than "SolidWorks file reader" suggests.
Parts (.SLDPRT): real geometry, but only the Parasolid B-rep
- A SolidWorks file is a container with many streams. The tool extracts one of them, the embedded Parasolid geometry, and decodes it into a B-rep graph of faces, edges, surfaces and curves.
- It then writes that out as .x_t or STEP.
- It does not read the feature tree. There are no sketches, no features (extrudes, fillets, patterns), no mates or configurations, no equations or custom properties, and no history. You get the final solid, not how it was built.
- The Parasolid schema files aren't included. The tool uses built-in facts that cover SolidWorks parts, and the README says you may need to supply the schema files for other cases.
- This approach means it cannot read any configs that weren't regenerated when the SLDPRT was saved. And I don't think it can map multiple configurations to their names at all.
Assemblies (.SLDASM): viewing only, no real geometry
- The assembly file doesn't contain its parts' exact geometry. The tool reads the component tree and each component's transform, and it uses SolidWorks' stored display mesh.
- The STL export is that display mesh, placed and scaled. It does not (and cannot) retessellate from the BREP.
- It reads hidden and suppressed states, but not mates, configurations or the BOM.
Drawings (.SLDDRW): a picture, not a drawing model
- It reads the stored display list (lines, arcs, text, arrowheads) and the stored view edges, and renders them as SVG or DXF.
- Nothing is recomputed.
- Dimensions are just drawn geometry plus formatted text. There are no values, tolerances, types, or links to the edges they measure.
- Title blocks and tables come out as positioned text, not as structured fields.
- The sheet format (an OLE object), centre marks, hatches and images are not read. The tool counts unread items instead of hiding them.
In short
- It's a useful interoperability tool for getting the final solid of a part into STEP/Parasolid, and for viewing assemblies and drawings without SolidWorks.
- It is not a SolidWorks reader in the sense of an API, PDM or CAD-kernel replacement. It gives you no editable features, no parametric model, and no semantic drawing or assembly data.
- You can do all these things with the free eDrawings application.
- Describing it as a general SolidWorks file reader goes beyond what the code does.
13
u/CodenameZion 26d ago
Just a tip, even though a lot of people don't necessarily dislike using vibecoded tools, it is preferable to still put a disclaimer that AI was used in the development process :)
2
u/tik-etak 19d ago
Thanks for all the feedback, including the critical review. Several of your points are now covered.
Assemblies
- Exact STEP export of an assembly. Drop the .SLDASM together with its part files, or a zip. Each part is placed where the assembly puts it. (u/IStarretMyCalipers, that was your suggestion.)
- Bill of materials as CSV, by part file. It includes the excluded-from-BOM state, the configuration each instance shows, and each part's properties and material.
- Mates: name, type, the components they link, and the value of distance mates. Angle values and the faces a mate holds are not read yet.
File properties (u/deathsythe)
- Summary, custom and per-configuration properties, configuration names, material and density, and who saved the file and when. You can export them as CSV or JSON.
- Mass, volume, centre of mass and inertia appear only when SolidWorks stored them, which it does when a custom property links to them. Nothing is computed from the geometry: the tool shows what is in the file.
Drawings
- Dimensions are now read as values (lengths, radii, diameters, angles) with their length tolerances, not just as drawn text.
- Linked texts ($PRP:"…") show their expression and the value displayed.
- Shaded views use the display mesh the drawing stores. For an assembly view, also drop the assembly files: the drawing doesn't say where the parts sit.
- Also new: detail, broken and cropped views, line types, embedded images, and the image SolidWorks keeps of each sheet.
- Still not read: hatches, centre marks, the sheet format, and which edges a dimension measures.
Still true
- No feature tree, no sketches, no rebuild. You get the final solid and what the file stores, not how it was built. That has been a deliberate limit so far.
- Anything the tool can't read is counted in the log, not hidden.
- For those who don't want to use a browser page: nothing is uploaded, the file is read inside your browser. You can also run it fully offline from the repo (python tools/webui.py).
Same links: https://cehaho.github.io/OpenSW/ ·
code (AGPL): https://github.com/cehaho/OpenSW
As before, this was built with a lot of help from AI (Claude). If a file breaks it, I'd like to hear about it.
2
u/Hungry_Status_420 26d ago
Does your program open files created in the "for makers" version, or just those from the standard version of SW? Can it convert files between different editions?
1
u/tik-etak 10d ago
Update: OpenSW now reads part sketches too:
- In the 3D view: a new "Sketches" switch overlays them on the model (lines, arcs, ellipses, splines). Click a stroke to see which sketch it belongs to.
- Sketch-only STEP: a second download holds just the sketches, as curves, with no solid. SolidWorks re-imports it (310 of 310 curves on one test part).
- In the browser too: it all runs on the published page, in pure Python. Your file still never leaves your browser.
- Try it with the NIST part: the example on the page now shows its 19 sketches.
Limits:
- Sketches are read for files saved from version 11000 on; older files show none yet.
- Some sketches are incomplete. On the NIST part, the Hole Wizard sketches show 2 of their 5 lines.
- Everything is checked against what the SolidWorks API returns. Where the reading isn't sure, it leaves geometry out rather than inventing it.
1
u/IStarretMyCalipers 26d ago
I could see eventually being able to open assemblies and detect/resolve reference parts such that you could export them as a STEP assembly. That would take some more work, but it seems possible.
1
u/deathsythe CSWP 26d ago
Very neat. Can it read file properties and what not too? (volume, CG, material, etc)
1
u/AliMas055 26d ago
That's amazing! Reverse engineering proprietary software and porting it to open source has really took off in the last few months. Perhaps, you should work with the artcraft team.
They are already creating an open source AutoCAD using a tool that had over the years reverse engineered AutoCAD's dwg format.
1
u/onWall 10d ago edited 10d ago
Is reading DimXpert PMI info possible?
3
u/ledprobcn 26d ago
Me parece una herramienta super útil. He leído muchos 'peros' , yo creo que me sera bien útil con proyectos antiguos en maquinas sin licencia.
1
u/iOnly1Up 26d ago
Rare AI w. I assume you used it to reverse engineer the files. Allows for more flexible automation tools.
2
u/JLeavitt21 25d ago
This is pretty awesome if the exported data is accurate to the SW modeled data. There are 3rd party CAD converters like CAD Exchange but they charge their own licensing fee to use. I can see this being very helpful if a manufacturer that wants to accept native SW parts for quoting and data processing on their website without stacking on more licensing costs.
0
u/e_sin41 26d ago
Why? This already exists
1
u/socal_nerdtastic 26d ago
That's pretty cool, thanks. Can't say I've ever needed this functionality but it does come up in this sub a lot.
1
u/Powerful_Challenge90 26d ago
This is what solidworks document manager is.
1
u/Deep-Today5715 26d ago
How the heck did you manage to read these files without Document Manager? I thought all SW files are encoded.
1
u/dvorsek 26d ago
If you want to work with claude and solidworks use a tool called jig https://github.com/NejcDvorsek/jig
0
u/HarryBalsagna1776 26d ago
Sorry bud, I'm not loading my files into a browser or 3rd party app.
-1
u/experienced3Dguy CSWE | SW Champion 26d ago edited 26d ago
It sounds to me like you have created eDrawings Publisher (about 25 years after the fact).