💾 Archived View for tim.clifford.lol › blog › 0001-dracula-for-solidworks captured on 2023-06-16 at 16:20:59. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-06-14)
-=-=-=-=-=-=-
494 words, about 2 minutes to read (300 wpm).
First published on 2021-04-12.
This article has been loaded 359 times.
Hah! Who says proprietary programs can't be themed?? SolidWorks never stood a chance. I even edited a DLL with vim.
Despite my comments in this blog post[3], there are a few proprietary programs which I am tied to, with no hope of escape. One of these is SolidWorks, a 3D Computer Aided Design program used extensively in many engineering teams.
I have spent many hours late at night using SolidWorks, and having a dark theme really does help prevent eye strain. As for why Dracula, that much is obvious.
SolidWorks doesn't expose a theming mechanism for many of the important colors in the UI, and it's not open source so I can't just fork it, but obfuscated or not, a color code is a color code, and I figured I should be able to find it with grep. A bit of regex fu latex and I was staring at this line...
grep: swStyleBlueu.dll: binary file matches
Now, the appropriate response here is probably to think "Ok, let me find a program designed for dealing with DLLs" (or, alternatively, to give up). But naturally the only thing I was thinking was "Can I open it in vim". And what I found was a veritable goldmine...
Some color codes I found embedded in a DLL
Yep, that's some sort of style description *embedded in plaintext in a DLL*. And even better, there are comments! Comments which they thought nobody would see...
(As a side note, I couldn't figure out for the life of me what tabstop they were using. Literally nothing would get the comments aligned. Were they just... incompetent?)
Here are my favourite comments, reformatted for my sanity:
// Debug testing colors. Use this to show a custom area with very bright and obnoxious color so it can stand out during debugging. // jps... I MADE THIS UP. NOT CLEAR FROM IMAGES WHAT IS "PRESSED" VS. "SELECTED" // thx nvidia for the bug.. :( // consequently this is no good to do something here !! // !! magic // what for ??? // WARNING: setView(-1) CRASHES !! // TOTEST !!! // ERROR TO BE HERE!! // This one is broken
Needless to say, I have some questions about the development practices at Dassault Systèmes...
(As an aside, here's the script I used to find all the comments. Beautiful, I know.)
#!/bin/sh for i in $(find . -name '*.dll'); do vim \ +"set lazyredraw" \ +"g/^[[:print:]\r]*\(https\?:\)\@<\!\/\/[[:print:]\r]*$/.,.w! \ >>//10.0.2.4/qemu/swout.txt" \ +'q!' $i done
Anyway, naturally, I then wrote a script to change the colors and voilà, Dracula for Solidworks. But the story's not over. Have you been wondering why there are still ugly grey bits in the screenshot? Yeah. I found the variables for that, and tried to change them. SolidWorks refused to start.
3: https://tim.clifford.lol/blog/why-foss
No comments yet! Tell me what you think!