Page 1 of 1

Adding quantity and thickness to the name while saving the file

Posted: Mon Jul 05, 2021 6:44 am
by Ömür Tokman
Hello there,
The macro below is @artem's
This macro saves the sheet metal products in the assembly flat in a folder.
I want to add sheet thickness and quantity to the file name you saved, I've been trying for about 4 days, but I still couldn't get a result.
the quantity and thickness I want to add is in summary information/Custom.

Is there anyone who can help me with this?

For example
The result you want = Part1-1mmDKP-1 Piece
--Const OUT_NAME_TEMPLATE As String = "DXFs\<_FileName_>_<_Thickness_>_<_AutoQty_>.dxf"---
2021-07-05_13-18-07.png
https://www.codestack.net/solidworks-ap ... -patterns/
2021-07-05_12-40-59.png
2021-07-05_12-40-59.png (13.77 KiB) Viewed 3722 times
Sac-icin-montajdan-dısari-dxf-ver - AT - 003.swp
(115.5 KiB) Downloaded 143 times

Re: Adding quantity and thickness to the name while saving the file

Posted: Mon Jul 05, 2021 7:49 am
by Jaylin Hochstetler
You have to put "$PRP:" before a the custom property you want in the file name.
You also have to enter the address of the folder such as "C:\New folder\DXFs". You had entered "D:" but you have to enter "D:\DXFs". "DXFs" is the folder the macro creates.

Code: Select all

Const OUT_NAME_TEMPLATE As String = "C:\New folder<_FileName_>_<$PRP:AutoQty>_<$PRP:Thickness.dxf"
Attached is the macro you posted revised with the custom properties. I also attached my version of it which includes options to give the folder a different name, export with or without sketches (which would be for etching), export with or without bend lines, and enter a different location for the folder either via browsing or entering the address.

Re: Adding quantity and thickness to the name while saving the file

Posted: Mon Jul 05, 2021 8:39 am
by Ömür Tokman
Jaylin Hochstetler wrote: Mon Jul 05, 2021 7:49 am You have to put "$PRP:" before a the custom property you want in the file name.
You also have to enter the address of the folder such as "C:\New folder\DXFs". You had entered "D:" but you have to enter "D:\DXFs". "DXFs" is the folder the macro creates.

Code: Select all

Const OUT_NAME_TEMPLATE As String = "C:\New folder<_FileName_>_<$PRP:AutoQty>_<$PRP:Thickness.dxf"
Attached is the macro you posted revised with the custom properties. I also attached my version of it which includes options to give the folder a different name, export with or without sketches (which would be for etching), export with or without bend lines, and enter a different location for the folder either via browsing or entering the address.
Hi Jaylin,
Thank you so so much, both work perfectly! ><
And thank you for teaching me how.

Re: Adding quantity and thickness to the name while saving the file

Posted: Mon Dec 20, 2021 3:39 pm
by DLZ_SWX_User
We have been using this Macro from @artem 's also. It works very well.

We have modified it to give us the quantity of parts needed of a particular DXF, if a multi bodied part has a linear pattern or a mirror image, by using the following:

Const OUT_NAME_TEMPLATE As String = "<$CLPRP:Sheet Metal Thickness> <_FileName_> <$CLPRP:QUANTITY> <_FeatureName_> .dxf"

My question is can we somehow do the same from an assembly? Currently if I have a table with 4 legs, either 4 of the same inserted into the assembly or using linear pattern it will only tell me "1" in the file name not 4. If I create this same table as a multi body part it will tell me "4" in the file name not "1" which is what I would like for it to do in assemblies.

I have tried to use what was stated above could not get it to do what I wanted.

Re: Adding quantity and thickness to the name while saving the file

Posted: Tue Dec 21, 2021 12:44 am
by artem
@DLZ_SWX_User, I have just published this new macro yesterday which addresses this issue:

Re: Adding quantity and thickness to the name while saving the file

Posted: Wed Dec 22, 2021 7:27 am
by Jaylin Hochstetler
artem wrote: Tue Dec 21, 2021 12:44 am @DLZ_SWX_User, I have just published this new macro yesterday which addresses this issue:
Thanks, Artem!