Render Queue (ish) for Revit

I love using the simplified rendering capabilities of Mental Ray in Revit 2009 and 2010, but it’s a hassle to do large numbers of renderings. Unfortunately, there’s no batch render functionality and the API doesn’t yet have controls for the necessary functions. However, using the journaling mechanism built into Revit and a handful of VB script techniques, you can build a render queue that, while lacking in User Interface, works pretty well.
This is a render queuing script that I built about a year ago and have refined a bit (one for revit 2009, on for revit 2010). It isn’t pretty, but it gets the job done, at least to make multiple renderings from a single file.


[Edit: There are variations and developments of this script with a more user friendly Graphic Interface at these locations:
Revit Batch Renderer: Beta 2.0

Batch Render . . . In French]

To use it you will need to do the following:



  • Put on your propeller hat. Tinfoil will work too.
  • Put the script in the same folder as the .rvt file to be rendered.
  • Set your render settings (names of views, quality, size, etc) in the space provided. 2010 version has a bit more functionality than the 2009 version. (Please read the instructions in the script carefully, it's easy to put in bad information and the script is a sensitive hothouse flower.)
  • Save changes and drag this file from Windows Explorer onto your Revit shortcut icon to run. Images are saved in the same folder, so make sure to remove all output before running for a second time, as the script will fail if you try and overwrite exisiting files.

Caveats: The last saved state of your file MUST be:

  • All views to be rendered in the file MUST have render settings set to "print" NOT "screen"
  • Render quality of each view must be set to something other than target output (i.e. you can't save the view with quality set to "High" if script is going to set it to "High" too).

The script shouldn't make any changes to your file, as it undoes alterations to your file before closing and there is no “save” at the end (workshare files do a "Relinquish elements and worksets" upon exit).

Tips: I recommend first trying out this script with your images very small and quality very low. That way you can trouble shoot the batch you intend to print (I often screw up getting the view names EXACTLY right). If you do this, don’t forget to delete your resulting low quality images, as the script will fail trying to overwrite them when you run it for a second time.

I’m sure someone out there with better scripting abilities can make something more comprehensive (something that could render from multiple files, for instance) and I’d invite anyone to use this script to do so. I’ll probably make some additions to it later to save out multiple exposures of the same image. If anyone has suggestions about how to improve the functionality, leave some comments and I’ll see what I can do.

As with anything you download from some bozo on the interweb, use at your own risk.

{Edit: There are variations and developments of this script at these locations:


Revit Batch Renderer: Beta 2.0

Batch Render . . . In French]

21 comments:

craig said...

Awesome. Thanks Zach

Architect said...

How long did it take you to figure out all that?

Anonymous said...

lovin' the candy du jour :)

-chico

Anonymous said...

oh yeah, and also lovin' the new background for you title.
q: could you make the candy enlarge-able?
-c

Zach Kron said...

"How long did it take . . ."
My job has me working in the Revit journals on a daily basis, and I was doing this sort of stuff with the rendering functionality pretty regularly for several month. So it's hard to estimate.

Zach Kron said...

"could you make the candy enlarge-able"
Yep. Thanks for the comments

Sean Doughtie said...

In the next version you can make it network render. ;) Thanks for the work!

Liz Raycroft said...

Thank you so much for this batch!!! I have been looking for something like this for ages- I am pretty sure this is the best thing since air.
My design principal's problem with Revit is its lack of quick batch rendering ability ("Like Microstation") without taking it into 3DsMax, which this has solved!! One of my project teams started using it the day I got it, & it has already saved them from having to stay in the office all night just to hit render - they thank you for their sleep!!

(I did have to remove one line that it kept getting hung up on:
Jrn.ComboBox "Modeless , Rendering , Dialog_Revit_ProteinRenderingDlg" , "Control_Revit_RenderDpi" , "Select" , "Custom (" & ResolutionDPI & " dpi)"
but after I removed that it worked perfectly!)

Zach Kron said...

Liz,
Glad it's working for you. I have gotten similar comments about the redundant piece of code. I can't quite diagnose when it's used and when it isn't (I'm assuming that you are using r2009?). I think you might need it for non-workset environments. Thanks for the bug fixing!

mjewell said...

Zach - thanks for the script! This is just what some of us (perhaps architect-types) needed....now I can start billing for my time in the middle of the night while I'm sleeping soundly not dreaming about revit. I hope to have some more time in the near future to continue to play with it - lots of potential now that you've done the hard part...

Anonymous said...

It seems to have issues rendering a 3D view that has not been set by a camera... any thoughts?

Zach Kron said...

What sort of problems? Can you send me the resulting journal?

The Revit Kid said...

Hey Zach,

I noticed a problem when attempting to render a 3D view that is not based on a camera. The problem appears to be during the first set of code after Revit opens the files (The crop region and show camera portion).

I duplicated the default 3D view and set up a few different views using that. The error prompts something along the lines of the journal and "run in interactive mode"

Great script though... worked great for any camera views I set up. I even began to tweak it and have Revit show a mass before rendering.

Thanks!

Zach Kron said...

Glad to hear you've figured out how to make the script your own . . . sorry about the 3d orthographic views, I don't render them very much. Are you using the 2010 or 2009 version? If it's 2010, I'm guessing it fails with the 7 lines after 'set image size. Try to take these lines out and see what happens (the 2009 version does not have image size control in the script).

The Revit Kid said...

Yeah I am using it with 2010.

I will give it a try with removing the lines.

Thanks!

Jean-Marc COUFFIN said...

Hi there,
first a big thank you. I have been seeking that kind of tool for quite some time now.
I have been tweaking it to make it work for half an hour now and I keep getting the same errors. I am using 2010 but in Fr, what I assumed first was the Fr translation of some of the script and actions. I change Views to Vues as per the french version... it didn't work. I tried the 'set image size tweak. and all noted above... still it does not seem to work and I get the same error as the Revit Kid said: "The error prompts something along the lines of the journal and "run in interactive mode"" , I also tried the no tweek version of the script.... I get stopped at line 40 then if i tweak the two lines at line 45 of the file. any guess?

Jean-Marc COUFFIN said...

I got it working... yuppa!
damned translations...
I wish they kept all journal files in english to be consistent.

here you are with my solution:

switch this line:
''''''''enter your desired quality, choices are Draft, Low, Medium, High, or Best
RenderQuality = "Low"

for that one:
''''''''enter your desired quality, choices are Qualité brouillon, Qualité inférieure, Qualité moyenne, Haute qualité or Qualité optimale
RenderQuality = "Qualité inférieure"

and also:
Jrn.Browser "ToggleExpandedState" _
, ">>Views (all)>>3D Views>>"
For Each View in ViewArray
Jrn.Browser "Activate" , " "
Jrn.Browser "SelChange" , ">>Views (all)>>3D Views>>" & View & ">>"
Jrn.Browser "LButtonDblClk" , ">>Views (all)>>3D Views>>" & View & ">>"

for that one:
Jrn.Browser "ToggleExpandedState" _
, ">>Vues (all)>>Vues 3D (3D View)>>"
For Each View in ViewArray
Jrn.Browser "Activate" , " "
Jrn.Browser "SelChange" , ">>Vues (all)>>Vues 3D (3D View)>>" & View & ">>"
Jrn.Browser "LButtonDblClk" , ">>Vues (all)>>Vues 3D (3D View)>>" & View & ">>"

Julia said...

Hi,

I have tried this script file a multitude of times, both at work and home and continuously get a error message with the journal file. I am trying in 2010 64 bit machine with Widow’s Vista and have tried taking out the line like recommended but with no success so far. Do you have any more recommendations?

Thanks

Zach Kron said...

Julia,
Have you tried the graphic front end version with the same results?

Ad said...

Is it also possible to render an entire or partial walktrough with this batch?

Please let me know

Zach Kron said...

I'm afraid this can't be used to render walkthroughs. (This is an interesting question, though, as walkthoughs are themselves batch processes)

Post a Comment