20090527

API Yi Yi

There are a gazillion little "samples" of plugin functionality code that come in your box of Revit, mostly tools that demonstrate simple repeatable tasks that can be automated by an API developer. They live in the "tools and utilities" section of the installation dvd, and once deployed, live deep in a set of subfolders where it is cool and dry. Although meant for hardcore API developers to cut and paste and assemble other functionality, these little snippets of code can become useful applications in the Revit environment with little alteration. For me, the problem has been how to turn these snippets from unintelligible bits of code into a button I can push and watch wonderful things happen. I FINALLY figured out how to do this, using the freely available Visual Studio Express to compile the code, and would like to start sharing some of these little treasures with you all. However, tonight I'd like to just show you how to hook up one of these compiled bits of code. If I was a real developer, I would give you an installer and we'd all just call it a night. But I'm not, so we can do this old school.

My favorite snippet is one that my friend Harry wrote for use in the 2010 Massing environment. Conceptually, it's really simple, it calculates the distance between curtain panel by pattern instances and some other placed family, then writes this number to an instance parameter in each panel. But once we hook this parameter up to some geometry and formulas . . . oh the fun we can have!

Direct relationship: farther from target, larger hole
Inverse Relationship: farther from target, smaller mullions
Decaying Sine Wave: oscillating opening and closing with less change after each oscillation
(Thanks to Dave B )
[Edit: Angela German has written an installer for this pluging, available on this post: http://buildz.blogspot.com/2009/07/api-yi-yi-installer-for-distance-to.html]
Now the hard part: boring instructions to adhere to, followed by the ability to make pretty things. Here are sample files and the ReadMe that comes with the code, as well as my compiled plugin, DistanceToPanels.dll, put it someplace on your hard drive, like C:\\Revitplugins\

[Assuming you have Revit 2010,] Locate a file called Revit.ini (usually in C:\\program folder\Autodesk Revit 2010\program\). Make a copy of this file before f-ing it up so you can back out changes if necessary. Open Revit.ini in a text editor like notepad or word. You are going to need to paste in the following information down at the bottom:

[ExternalCommands]
ECCount=1
ECName1 = Compute distance to panels
ECClassName1 = Revit.SDK.Samples.DistanceToPanels.CS.SetDistanceParam
ECAssembly1 = C:\Revitplugins\DistanceToPanels.dll
ECDescription1 = Compute the distance from a selected object to all panels and store in a panel instance parameter

Replace "Revitplugins" with the path to where you put your DistanceToPanels.dll
If you have already installed a plugin (like the stl exporter, you will already have the [External Command] section, and you'll need to append it to account for this new plugin. For instance, my Revit.ini looks like this:

[ExternalCommands]
ECCount=2
ECName1=Revit Extensions for Autodesk Revit Architecture 2010
ECClassName1=REX.AREXRevitMngr.Manager
ECAssembly1=C:\Program Files\Autodesk\REX\Revit 2010\AREXRevitMngr.dll
ECDescription1=Manager for Revit Extensions for Autodesk Revit Architecture 2010
ECName2=STLExport
ECClassName2=Autodesk.Revit.ExternalCommand.STLExport.Entry
ECAssembly2=C:\Program Files\Autodesk\STL Export for Autodesk Revit 2010\STLExport.dll
ECDescription2=Export model to stl file

So I would need to change ECCount=2 to now say ECCount=3 , and the rest gets updated to 3

ECName3 = Compute distance to panels
ECClassName3 = Revit.SDK.Samples.DistanceToPanels.CS.SetDistanceParam
ECAssembly3 = C:\Revit SDK 2010\DistanceToPanels.dll
ECDescription3 = Compute the distance from a selected object to all panels and store in a panel
Make a curtain panel by pattern with a length instance parameter "Distance", load it into a divided surface in a mass FAMILY (not an rvt). Select another family in the massing environment and push the magic button in the Add-Ins menu.
Caveat: I think this only works on rectangular panels.
If someone out there is handy with autohotkey or some other application, how about whipping up a little installer?
Happy Paneling!

20090524

Tensegrity Wall Follow Up

I got exactly one request for the family from the tensegrity wall post from last week, but couldn't resist rebuilding it anyway. It's made pretty differently than the first one I did back in November, but I think this is better.
Download the rfa file from here.

20090522

Flip, Flop, Fly Apart Panels: A Workaround


[Edit: this bug is fixed in current web updates]
You've just finished doing Dave's excellent tutorial on dividing and paneling a form in Revit, it looks awesome, now you want to make some renderings to put on your Grandma's Ceiva. You load it into the Revit project environment, place and . . . .

[Cue sad trombone.]Mwa-mwa . . . all your panels have blown off! Perhaps you might write a haiku:





Expensive Panels
Drifting Autumn Leaves in Spring?
Revit Has Some Bugs




Indeed, this is a bug . . . sorry. Panels that have the "flip" OR "mirror" parameter checked in the divided surface properties dialogue will blow off the form when loaded into the project environment.



However, the unlikely workaround is this: If you use BOTH MIRROR AND FLIP. . . no problem! So as long as you are not picky about a left/right aspect of your panel and are simply trying to make an inside/outside distinction, you are back in business.
[Edit: this bug is fixed in current web updates]

20090520

Building a Tensegrity Structure

Back in November of 2008, when the new Revit massing and paneling tools were but infants, crawling around on the floor of the factory, Matt sends me this link to Lift Architects. They're making tensegrity structures in 3dsMax and he says "I'm buying beers for the first person who makes one with the new toys". Unfortunately, I'm a sucker for this sort of thing, especially late at night when I'm out of beer.



Some of the tools look a little bit different now, but here is the "behind the scenes: the making of the Tensegrity Wall". Sorry it's a little dry, no narration, and the resulting file got kind of corrupted over the next few months of development. If there's interest I can rebuild it and post the file . . . or I'll buy beer for the first person to build it . . .



20090513

Seamless Mullions

I did the Seamless Panel tutorial last week and realized that it ends up begging the question "how do I make a seamless FRAME". Building on that tutorial, here is one method to create such a panel.



The resulting frame, which you can download from here, has a couple shortcomings. Namely, the corner conditions don't clean up nicely. This is ok for most situations, but gets a little funky in extreme conditions. The nice thing is that it's really easy to control thickness and height of the mullion.

There's another method that uses a void and has much cleaner edges, but it is harder to control the thickness of the mullions. The creation of this one is a little more involved, so I'm not doing a tutorial yet, but here is the file for download. One thing you'll notice is that the mullion thickness is tied to the size of the panel.

20090509

Non-Industry Standard Workflow: Blender>Autocad>Revit

Where to begin to talk about Blender . . . Blender is an open source 3d modeling and animation package. It's one of those free applications that is both free as in "information must be free" and "free beer". Jeff McGrew calls the learning curve a “vertical wall”. Still, once you get inside a couple of it's features, it's a simple and satisfying application. The sculpting capabilities are lovely. Using a similar toolset to Mudbox, a user can push, pull and model a 3d shape like a lump of clay. I know a lot of people say that about different apps, but you really can say this about both Mudbox and Blender. I'm going to talk more about Blender because - unlike Mudbox - it has a dxf export option, which allows you to go directly into Autocad.

Because both apps use meshes to model, they don't work well with Revit. Meshes are surfaces made of polygons, not something you can slice up into floor plates, or make into walls. For reasonable walls, you need nurb surfaces, and to cut floors you need solids. This makes a Blender element twice removed from Revit usability. But these meshes are VERY pliable, and in just a few seconds, you can make anything from a fish to a biomorphic skyscraper.

Meanwhile, the geniuses over at the Autodesk Shape Manager lair have done something wonderful. They have stirred their magic cauldron and boiled some batwings and put some special sauce in Autocad 2010 that can CONVERT these meshes into NURB solids. Now, mind you, this was designed to convert shapes made in Autocad 's new organic modeling features into elements that play nicely with solid nurby applications. But you can throw all sorts of junk at the converter and get some very sweet results.

One major caveat to what is otherwise a love sonnet to the ASM team:
The converter LOVES subdivided surfaces made from cubes. Most other things, not so much.

Here's a smoothed pyramidal mesh made in native autocad geometry (left) that is converted into a solid (right).
The slices represent the new NURB patches that are used to sew together the new solid
Pretty, but I don't know what I'm going to do with those surfaces. I predict we are going to see a lot of student work that feature these distinct shapes, just like we saw lots of models that saw “opportunities” in the burnt edges that came as a by product from the early days of laser cut basswood.

Back to our non-standard workflow: This is essentially 6 square patches that have been massaged into a new shape in Blender (please see the earlier link to becausewecan.org to see how to get here).
Export it to DXF, import into ACAD 2010, explode the block. The ASM solidifytron recognizes the underlying architecture of the form and creates a solid that is made of 6 nurb patches (imported DXF from blender on the left, converted solid on the right). This solid can now be imported into Revit and used to make walls, curtain systems, and other Revit features. Perhaps most important: it can be used to make mass floors. So the big goofy topedo can now be a QUANTIFIABLE big goofy topedo: 58 floors, and 961,796 sf. [Note: terminology has been edited to say "torpedo" as previous wording seemed to attract a barrage of automated spam. Pesky interweb.] And then you can do the fun part of hanging curtain walls, dividing surfaces, and rendering.

20090508

Voting for AU Classes

Voting closes at Midnight PDT.
BTW, vote for me, I've submitted 2 proposals:
Complex Non-Planar Panel Design Using Revit 2010
Photographing BIM: Unreal Images Using Revit and Mental Ray

20090507

Hey Kids, Math is FUN!

Revit + Spreadsheet=Frick’n Awesome!

I know, seems unlikely that such a combination would create awesome. But that’s probably what you said before you tried banana flambĂ©.

This may be old news to some, but was delightful for me. The
add-on applications package for revit subscription folks has something exquisite called Excel Based Model Generation. With it, you can create and place beams, levels, walls, and footings through the basic and recognizable interface of a spreadsheet. I’m sure that there are some very practical and serious applications for this, but that shouldn’t stop you from breaking out your high school calculus book and making something swoopy.

I imaging you can also use it to talk back and forth between analysis platforms for more performance driven geometry. I haven’t looked around yet.

[Edit: .xls files used to create the above images can be downloaded from
here]


20090506

Seamless Panels

The new paneling functionality in Revit 2010 does some pretty new and fun stuff. Especially compared to the limitations of the old curtain panels. You can do non-planar, patterned, and all sorts of crazy, expensive stuff. One problem I hear about is people having difficulty making seamless edges. They make a nice clean panel and the edges look like Thing from the Fantastic Four. Out of the Box functionality is going to give you shapes like this:

When what you might really want is this:


The problem is that, unless you tell the panel otherwise, your geometry is going to extrude from the face of your panel relative to some calculated normal of the individual panel, and not have any relationship to it's neighbors. What you might want is a shared edge, which means a shared vector based on the edge condition, not the overall panel condition. In section, the difference is like this:

This video shows how to get the relationship that creates a seamless edge. The principle is that you want to build your geometry based on the planes defined by points, rather than on the overall plane of the panel.



20090502

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]