Below, we will take a look at a Revit multi-project batch PDF printer project driven by the Windows task scheduler and the Revit Idling event.
Before getting to that, though, let me share some of my Sunday activities.
From the Fells, I continued along the Mystic Valley Parkway and stopped to enjoy the beautiful Mystic Lakes on my way to the weekly Sunday contact improvisation jam in the Arlington Center, followed by a magnificent lunch at Sabzi Persian restaurant and wonderful conversation with Mike Klinger of Anzu Global, who actually used to work with Revit at Autodesk, as it turns out. Small world.
In the evening I checked in to the Tech Summit hotel on the Charles River in Cambridge and went for a very nice dinner with Adam, Manu and Mikako to the Spanish Tapeo restaurant on Newbury Street in Boston. That was the first time I set foot in the city since my arrival.
As Mikako pointed out, it is quite a novelty for me to be pleased with restaurant food – I normally prefer to cook myself – and on Sunday I had two good experiences in a row! Yay!
Back to the Revit API.
This is a contribution from Dan Tartaglia of design technology@NBBJ.
It started off from the following query:
Question: I created a tool that uses a UIControlledApplication Idling event when Revit launches. It works perfectly correctly in Revit Architecture 2013. However, if I use the same code on the same computer in Revit Architecture 2012, the Idling event does not fire.
Answer: In Revit 2012, the Idling event is not fired until a document is opened.
Response: Is it possible to open launch Revit then open a RVT file programmatically in Revit 2012? I can do this in Revit 2013 via the Idling event.
Answer: Yes, definitely. Simply specify the project filename on the Revit.exe command line.
Response: I got it to work after all. I just open a small dummy RVT before processing the RVTs for the users. I am using this to implement a batch PDF printer than can run from the Windows Task Scheduler overnight.
Based on this approach, Dan implemented AutoPDFPrint, a Revit multi-project batch PDF printer than can be driven by the Windows Task Scheduler overnight.
Dan underlines that the Task Scheduler and Revit API Idling event allow you to automate almost any task. A few that help my firm are:
Some new features in the Revit 2014 API make the above tasks easier still, e.g. the OpenDocumentFile method that now enables you to open workshared RVT files detached from central and determine which user created worksets are open or closed.
There are a couple of things you need to consider before running any of the above tasks:
Looking in more detail at the PDF printer system, one its parts is the AutoPDFPrint_Bridge executable run from the task scheduler:
The second component and the main actor in the process is the AutoPDFPrint Revit add-in:
Here are the detailed steps required to set up the system:
All components presented are available for download below.
C:\AutoPDFPrint2014\Scripts
100XXX.00 - My Project.cfg
<view/sheet set>,<print set>,<RVT file>,<output folder for PDFs>
Notes:
C:\AutoPDFPrint2014\Program\AutoPDFPrint_Bridge.exe
“100XXX.00 - My Project.cfg”
Notes:
Here is Auto_PDF_Print_from_Revit_2014_example.zip containing the following:
Thank you very much, Dan, for implementing and sharing this powerful tool.