SolidWorks API Gotchas: 7 Silent Failures — SelectByID2, Null Components & Rebuild Timing

Every SolidWorks API developer has spent hours debugging a macro that produces no error, no exception, and completely wrong output. The SolidWorks COM API is old enough that many of its failure modes predate modern error handling conventions — methods that silently return Nothing, boolean flags that are ignored, and side effects that modify document state without warning. This is a catalogue of the seven most common ones. Each has a pattern, a root cause, and a fix. ...

5 June 2026 · 9 min · CadShift

Live BOM from SolidWorks to Excel — Native Table, Macro, and the Better Middle Path

To export a SolidWorks BOM to Excel, you have three paths — and choosing the wrong one is how you end up maintaining a 200-line macro for two months before admitting it doesn’t quite work. A post on r/SolidWorks showed exactly that: a macro that exported an assembly BOM to Excel with description, material, length, thickness, quantity, and supplier data. It mostly worked. Six comments later, nobody had a better answer than “looks fine to me.” The approach was fine — the architecture was wrong. ...

17 May 2026 · 8 min · CadShift

How to Automate SolidWorks Drawing Creation with a Macro — And Why Task Scheduler Won't Do It

SolidWorks automation: four levels and where drawing creation fits SolidWorks automation exists on a spectrum. Understanding where each approach sits — what it costs to implement, what it can do, and where it breaks — saves engineers from picking a tool that is the wrong shape for the job. Level 1 — Record macro. SolidWorks’ built-in macro recorder captures UI actions as VBA code. You click through a sequence of steps, stop the recorder, and have a macro that replays those steps. This works for simple, identical operations: changing a document property across ten files, printing a drawing with fixed settings. It breaks immediately when the input varies — different part names, different view orientations, any conditional logic. The recorder also silently drops interactions with dialog boxes, property manager panels, and anything that requires polling SolidWorks for a return value. The SolidWorks macro recorder limitations guide documents exactly what it misses. ...

23 April 2026 · 14 min · CadShift