Macro to save all parts in assembly as step files?

First post! I migrated over here because the new SW forum is unusable.

I’m looking for a macro to save all the parts in a given assembly as step files. I found some stuff on the old SW forum but all the links seem to be gone. Does anyone know of anything?

Thank you!

Welcome! We seem to have a pretty API savvy group here, so hopefully someone can get you sorted out. Thanks for posting!

Yes, I know artem posted a link to all his macros and that one is there (also a lot more. Thanks Artem!). Let me do some digging and I’ll post a link here.

Forgot to extend a hello and welcome…So, hello and welcome to the forum!
Here’s the link to artem’s macros:
https://www.codestack.net/solidworks-tools/

Get the one that’s closest to what you need and post back here if you need help. As Matt posted, there are some good programmers here that can help (I’ll pitch in, but my advice compared to theirs’ is nowhere near as good).

Export the assembly to STEP or X_T and other can import and all the parts.
Usually with correct file name.

Exporting each part will require assemble.

Remember that if you want to share a macro, one great way to make sure it gains visibility is to use the Upload function in the menu bar at the top of the window. This way all the macros can be in one easy to search location.

Should be here:
https://www.codestack.net/solidworks-tools/

[mention]rosenrob[/mention] , you can use this macro: <LINK_TEXT text=“https://www.codestack.net/solidworks-ap … i-formats/”>https://www.codestack.net/solidworks-api/import-export/export-multi-formats/</LINK_TEXT>. It is pretty flexible with output folder and file naming (you can use a combination of free text, file name, custom property value etc.) and you can even use this to generate sub-folders. This macro runs on a single file. But you can combine this with free Batch+ for assemblies to run on all (or selected components) in the assembly: https://cadplus.xarial.com/batch/assembly/. Here is a short demo (although the UI there is from a newer, not yet released version), but it will give you an idea: https://www.youtube.com/watch?v=5akBj5gd68Q.

Damn you guys are quick! Thank you for all the help. I was originally hoping to be able to do this through Solidworks PDM which I have set up to create pdf’s when I release an assembly. Turns out you need the pro version to do that with step file, so here I am.

artem, I’ll give that macro a shot this morning. I am pretty new to macros so I may be back with questions.

artem, it works like a dream.

Thanks for the help everyone. Now time to dive deeper into the rabbit hole of macros.

Hello,

I am using solidworks 2019 With PDM. I have been Testing with multi format export

https://www.codestack.net/solidworks-api/import-export/export-multi-formats/

The macro works really good but I would like it to Name the drawing file with the part revision. Im not sure the input for that. I know solidworks has this for pulling revision from other areas but that does work “($PRPSHEET:{Revision})” I also cant get the macro to stop saving the part as a .PDF

The inputs I have used
OUT_NAME_TEMPLATES = Array(“<FileName>.pdf”, “<FileName>.x_t”)
image.png
We also Use PDM data card but I have tried “Dwg Rev”

image.png
image.png