Scripting Queries - Batch Exporting PDF & DWG with File Naming

Hi all

I am working on some scripts for batch printing and naming PDF’s and DWG’s out of Revit. I am using a couple of great videos from @GavinNicholls. Video links included:

PDF script video

DWG script video

My first question is, there appears to be a problem with the Crumple node ‘© Revit.PrintToPdf’. The first time I was writing and testing the script the node never worked. It would display no errors but just did not execute. A day or two later I returned to the script and was pleasantly surprised to see it working initially. Though after several runs it ceased to execute again and has not been doing so since. Is there possibly something I could be missing with this node? Perhaps in the PDF24 settings? Or is it unfortunately somehow a dud? I have noticed that the ‘PDF Printer’ settings in PDF24 seem to stuck to DiRoots output setting, as I currently also have DiRoots installed. But how can we explain the times it did work and the fact we are coding the path in the script?

Secondly (and more generally), what I am essentially trying to achieve, is a batch print/ export workflow that will name my files correctly. My title sheets actually use a couple of common text parameters in the drawing number and the revision. I first wrote the pdf script which uses the ‘© Sheets.NamedFormatted’ and I was really scratching head how I might get those text parameters into filenames. My initial ‘PDF script’ snapshot attached:

However, after then writing the DWG script which uses some of the ‘Data-Shapes’ interface nodes, I could see a nice way of getting those text parameter values into the file name. See my ‘DWG script’ and ‘PDF adapted’ script snapshots attached:


I suppose I am hoping that feeding the filenames into ‘© Revit.PrintToPdf’ in this way achieve what I am after. However, without the node working I can’t see. I mean it isn’t giving any errors. And I suppose I am also asking if there are any alternate PDF printing nodes out there? however the print setting functionality is very important in this process.

I suppose @GavinNicholls might be best placed answer some of these questions (your work is very much appreciated Sir), but all comers greatly appreciated also!

Please note, I may not be able respond immediately to any replies which is why I have tried to be very thorough. I will of course do my best to get respond ASAP (its in my interest) and any help is again greatly appreciated.

Sam

PS.

Seeing as those video links appeared not to work, I am just snapshotting the tittles for reference.

Hope that’s OK.

Thanks

I have a video showing how to use these nodes in my free guide here:

Generally, for print/export nodes i generally recommend only running once per session or using dynamo player once it is working.

Typically you will need to configure a printer that accepts save supression, my goto is pdf24. Each print driver is different and not all will suit printing via dynamo.

In lesson 03-06-01 i show how to configure a driver and in the lesson after how to print.

If you need to use diroots as well then i suggest using BioPdf instead as it will intefere otherwise. Note that the dynamo node/script isnt the culprit in that case.

You can alternatively use export to pdf node from 2022 onwards which i also show in my guide.

Note i released a new version of crumple recently with some bug fixes. I havent tested below revit 2023.

1 Like

Thanks Gavin

I’ll be sure to look into all this and let you know how I get on.

1 Like

Hey Gavin

It was the ‘delete me’ thing in the sheet sets. Everything seems to work great. You just have make sure you get rid of that.

Really appreciate your work!!

Can I ask what interference it might cause with DiRoots using PDF24 as well? It seems to working ok with both.

1 Like

For me it relates to the folder it expects to save to, but maybe it’s OK on some machines/setups. If it works, it works!

The delete me thing I’ve got some ideas on how to address, as if the node runs into issues it currently doesn’t get a chance to delete it.

1 Like