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"---
https://www.codestack.net/solidworks-ap ... -patterns/
Adding quantity and thickness to the name while saving the file
- Ömür Tokman
- Posts: 340
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 972
- x 328
Adding quantity and thickness to the name while saving the file
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.
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.
Go to full postYou 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"
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
- Jaylin Hochstetler
- Posts: 387
- Joined: Sat Mar 13, 2021 8:47 pm
- Location: Michigan
- x 379
- x 355
- Contact:
Re: Adding quantity and thickness to the name while saving the file
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.
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.
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"
- Attachments
-
- Sac-icin-montajdan-dısari-dxf-ver - AT - 003.swp
- (132 KiB) Downloaded 180 times
-
- Omur DXF Export.swp
- (165 KiB) Downloaded 203 times
A goal is only a wish until backed by a plan.
- Ömür Tokman
- Posts: 340
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 972
- x 328
Re: Adding quantity and thickness to the name while saving the file
Hi Jaylin,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.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.Code: Select all
Const OUT_NAME_TEMPLATE As String = "C:\New folder<_FileName_>_<$PRP:AutoQty>_<$PRP:Thickness.dxf"
Thank you so so much, both work perfectly!
And thank you for teaching me how.
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
-
- Posts: 27
- Joined: Mon Dec 20, 2021 1:40 pm
- Location: Michigan, USA
- x 121
- x 12
Re: Adding quantity and thickness to the name while saving the file
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.
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
@DLZ_SWX_User, I have just published this new macro yesterday which addresses this issue:
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
- Jaylin Hochstetler
- Posts: 387
- Joined: Sat Mar 13, 2021 8:47 pm
- Location: Michigan
- x 379
- x 355
- Contact:
Re: Adding quantity and thickness to the name while saving the file
Thanks, Artem!
A goal is only a wish until backed by a plan.