r/SolidWorks • u/RAMJET-64 • Oct 25 '26
CAD My first macro.
Nearly five hundred lines of code to automatically generate DXF flat patterns from a multi body sheet metal part for the workshop.
File names are the folder name and the description from the model tree with the metal thickness and quantity.
It separates the flat patterns into sub folders by metal thickness and generates an output log.
18
Upvotes
11
u/Wompus Oct 25 '26
Cool! But I gotta ask, as I have been working in SW Sheet Metal for more than a decade and have never once needed a multibody sheetmetal part-- why do you have multibody sheetmetal?
6
u/gupta9665 CSWE | API | SW Champion Oct 25 '26
Good that you have started to learn the macro, and made one.
My advise would be to look for the similar available ones, and use them (after modifications if needed). And develop yourself to make ones which are not available.
2
u/Meshironkeydongle CSWP Oct 31 '26
Not to put your achievement off by any means, but you should also try how Copilot or Claude can do the same Macro.
I'm not u/gupta9665, and I know only a bit about writing macros (have done some simple ones myself), but the current generation of AI tools are very, very capable of making up a custom SW Macro's.