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)
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.
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()
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.
@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.
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.