Try the macro downloadable from the link below. You will need to edit the macro to set your folder paths for your default drawing template (dwrdot) and your folder containing sheet formats. It was built for 2015, so you may need to update SOLIDWORKS library references if you're using an older version.
Look for these two lines to change in the main procedure...
'set to your default drawing template path
template = "c:\programdata\solidworks\solidworks 2015\templates\drawing.drwdot"
'set to your sheet format folder
formatPath = "C:\ProgramData\SolidWorks\SOLIDWORKS 2015\lang\english\sheetformat\"
That is what I was looking so far!!!!! Thanks a lot for now.....
only a problem: when I run the macro, it appears me "error run time 91 (variabile oggetto o variabile del blocco non impostata) >> object variable or block variable not set.
Where could be the problem? It correctly run, showing me the choice winwdows for PAPER SIZE and SHEET FORMAT, then appears the error message.....
EDIT: I try to run it using your original folder path (default for SWX 2015) and using my custom path, but anything works.....
There are a couple common problems that could be happening. Deepak Gupta has a great YouTube video explaining missing/updating library references here: Fix-Update SOLIDWORKS Macro References - YouTube.
Another possible problem is running the macro from the VBA editor and not starting with the main procedure. If you have the form active or have the cursor active in a different code block, you'll get errors.
If you run the macro from the main procedure and it still gives the error, post back where it is stopping and that will help determine the problem. Screen shots help a lot!
You can also use a free batch tool "#TASK". It has a library where macro for drawing creation can be found.
Just drag the folder with all your parts, specify the extension and add template location and all drawings will be created.
If you have a lot of files and SolidWorks hangs somewhere in the process then tool will reload SolidWorks and continue creating drawings
Please follow the link to download this batch tool: https://cloud.centralinnovation.com.au/WebSharpSwTask/Home/Index?lang=en
intro video: #TASK - your very own SolidWorks assistant - YouTube
It is a Beta version of the application. So please, back up your data if you haven’t done so already before running #TASK.
instructions.en.pdf 320.5 KB