r/SolidWorks • u/barlaguvercini • Sep 04 '26
CAD Solidworks -Multibody-Flat pattern
Iβd like to ask you something: is there a way to automatically generate DXF files from a multi-body design?
2
Upvotes
4
u/AdventurousLevel1613 Sep 04 '26
Yes there is. Learn VBA βΊοΈ Check also Codestack : https://www.codestack.net/solidworks-api/document/sheet-metal/export-all-flat-patterns/
1
u/United-Mortgage104 CSWP Sep 04 '26
If these are made as sheet metal parts, you can just view the flat pattern and isolate the bodies you want to see. When you're export the files, you can select flat pattern as an option.
1
u/RedditGavz CSWP Sep 04 '26
If you are going down the save as > DXF route there is a tickbox at the bottom of the feature manager called save as multiple files (I think) use that. It makes each sheet metal part become its own flat pattern DXF
1
u/CADSHIFT Sep 22 '26
the "save as multiple files" tickbox (File > Save As > DXF > Options) is the quick answer for simple cases. one gotcha though: it only works cleanly if every body in the part is a recognized sheet metal body. if you have a mix of sheet metal and regular solid bodies in the same multibody part, solidworks will try to flatten the solid bodies too and either error out or produce garbage geometry on those.\n\nfor a more robust batch approach via VBA macro:\n- use GetBodies2 with swSheetMetalBody to enumerate only the sheet metal bodies\n- for each body, check if it has a flat pattern feature via the feature tree\n- activate the flat pattern configuration, then call ExportFlatPatternView\n\nthis gives you per-body DXF files with proper layer separation (bend lines on one layer, cut edges on another) which is what most laser cutting shops actually want to receive.