Filename and Config name to macro

 

Hello :).

I would like to modify this macro to add a filename/configname to exported DXF name by part used in Assembly. 

The code works, and you can choose to add Filename or Configuration name. 

But in assembly there are parts that use configurations and parts that don't have configurations.

Here things start messy, if I take Filename, then all DXF named by corresponding filenames, and configurations are overwritten with one filename. Now if I choose ConfigName, then all 1 configuration parts (Which usually have "Default" Filename) are named as default and also overwritten.

Can these "tokens" in the codestack, be modified to use FileName and ConfigName depending which is used in the model and stop overwritting each other? 


The code is here:

https://www.codestack.net/solidworks-api/document/sheet-metal/export-all-flat-patterns/