I have these two codes (harvested on internet) that separately are doing great. But i need them to be one. My main objective is to generate only one file, and not two, as this code is retrieving; and with the same as my part.
This one is working great, both is actualy, but this is creating two dxf files and I only need one of them. Beside, it create using the "view name" i rather it to be the file name.
https://www.codestack.net/solidworks-api/document/drawing/export-sheet-metal-views/
The next one doesnt works properly but it uses the file name, to name the new file. Macro to export Solidworks Part to dxf
Solution based on this code:
https://www.codestack.net/solidworks-api/document/drawing/export-sheet-metal-views/
Tested with one drawing that has already been saved and with only one view that is a flat-pattern view.
To solve the question of having two files being saved replace this code:
With this one:
For some reason the original code is getting the same view twice, but with different names. Would need some more time to check why.
To save with filename change the code where
filenameis being assigned.Since the
ModelDoc2is as drawing file theModelDoc2.GetTitlewill return the file name and the sheet name.