Batch export of Revit drawing sheets in dwg

Hi all,

I know this is all done before and with all internet help there is out there and Youtube tutorials, I’m still having issues developing this script and finalising it.
I am working on Revit 2024 and want to create a batch dwg export of selected sheets. I’ve created 2 branches, one for PDF export which works great and another one for dwg exports which it’s not working properly and I can’t see where the issue is. If I run it, it will export only the first sheet of the project and not the batch selected by me. Will someone be able to help and help me fix this? I’ve attached the script below for reference. I am very new to Dynamo and Python language, so this is all a new language I’m learning here.
DWG and PDF Export.dyn (102.9 KB)

Thanks in advance for your help.

What if you set Merge Views to false?
I dont have the packages you are using so what are the input values for these three inputs? Post a screenshot perhaps?

Hi BimAmbit, Thank you for your reply.
MergeViews button will merge all views in one single dwg file, otherwise they will be printed separately, as linked files, while transporting. This is same as when you do a simple dwg export through Revit, that you have to tick the merge all views button otherwise all will come like this.

The issue I don’t get it as to why my script is not collecting all sheets?


see if this works?

Hi, no, unfortunately it still did only the first drawing sheet.

What is the name of the package?

GeniusLoci.

Worth a try is to modify this package just a bit. Open up the python node inside that dwg node, then comment out the “ProcessParallelLists” call, and call the “ExportDwg” yourself.

try:
    errorReport = None
    # run export
    #ProcessParallelLists(ExportDwg, names, views)
    for name, view in zip(names, views):
        ExportDwg(name, view, folder = folderPath)
        
except:
    # if error accurs anywhere in the process catch it
    import traceback
    errorReport = traceback.format_exc()

Hi there,
No , still it didn’t work. Now it’s not exporting.


I did the following as you asked, and the result is null.

I actually copied them out in a regular python node. What’s interesting on my machine is after doing so (including code modification), it gives me all the sheets. Without doing it, it gives me null.

This is strange then, as mine won’t do it, still null.
This is the script after I’ve modified to your code on a python script.
Am I typing something wrong here? that was only copy and paste and adjusted the lines.


Hi have you tried set python to 2.7 ?

Hi there, it did help a little, but printed out only 3 more drawing sheets, not the whole package, I have like 10-15ish.



Cheers

hm that error complains on formatting.

14f8e48290062b47b97d219f95939a98a31116ab.dyn (124.4 KB)

The error seems quite clear. You might be using filename characters that arent permitted in windows file names.

1 Like

Thank you for sending this @BimAmbit but, it still does only 4 drawings and now the error is this


Still not collecting all sheets.

@GavinCrump I don’t seem to understand this. I have no experience on python language, as I’m just a technician. Would you please explain in plain language where I’m doing wrong so I can fix it? to be honest I tried both ways, copied and pasted, and also typed in the code.
Thanks. :slight_smile:

Id advise against tinkering with the code then.

This is my bulk export dwg script which should work in most builds:

As i said my guess is based on the error you saw you’re trying to pass file names in the export process with characters windows doesnt support, hence why some are workiny and some arent.

As @GavinCrump stated, make sure you don’t have any characters that are invalid for a common Windows filename. Basically when it gets to the sheet with the invalid characters is stops working. Try something simple with the names as shown below and go from there.

Personally if a addin does a better job than
Dynamo i would go for the addin.
We use DiRootsOne for stuff like this.