Macro to save all parts in assembly as step files?
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!
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!
Re: Macro to save all parts in assembly as step files?
Welcome! We seem to have a pretty API savvy group here, so hopefully someone can get you sorted out. Thanks for posting!
Blog: http://dezignstuff.com
- mattpeneguy
- Posts: 1386
- Joined: Tue Mar 09, 2021 11:14 am
- x 2489
- x 1899
Re: Macro to save all parts in assembly as step files?
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.
- mattpeneguy
- Posts: 1386
- Joined: Tue Mar 09, 2021 11:14 am
- x 2489
- x 1899
Re: Macro to save all parts in assembly as step files?
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).
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).
- Frederick_Law
- Posts: 1947
- Joined: Mon Mar 08, 2021 1:09 pm
- Location: Toronto
- x 1638
- x 1470
Re: Macro to save all parts in assembly as step files?
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.
Usually with correct file name.
Exporting each part will require assemble.
Re: Macro to save all parts in assembly as step files?
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.
Blog: http://dezignstuff.com
- DanPihlaja
- Posts: 849
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 812
- x 979
Re: Macro to save all parts in assembly as step files?
Should be here:mattpeneguy wrote: ↑Thu May 06, 2021 2:22 pm 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.
https://www.codestack.net/solidworks-tools/
-Dan Pihlaja
Solidworks 2022 SP4
2 Corinthians 13:14
Solidworks 2022 SP4
2 Corinthians 13:14
Re: Macro to save all parts in assembly as step files?
@rosenrob , you can use this macro: https://www.codestack.net/solidworks-ap ... i-formats/. 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:
Thanks,
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Re: Macro to save all parts in assembly as step files?
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, I'll give that macro a shot this morning. I am pretty new to macros so I may be back with questions.
Re: Macro to save all parts in assembly as step files?
@artem, it works like a dream.
Thanks for the help everyone. Now time to dive deeper into the rabbit hole of macros.
Thanks for the help everyone. Now time to dive deeper into the rabbit hole of macros.
Re: Macro to save all parts in assembly as step files?
Hello,
I am using solidworks 2019 With PDM. I have been Testing with multi format export
https://www.codestack.net/solidworks-ap ... i-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_><Revision>.pdf", "<_FileName_><Revision>.x_t")
We also Use PDM data card but I have tried "Dwg Rev"
I am using solidworks 2019 With PDM. I have been Testing with multi format export
https://www.codestack.net/solidworks-ap ... i-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_><Revision>.pdf", "<_FileName_><Revision>.x_t")
We also Use PDM data card but I have tried "Dwg Rev"