It’s been a quiet week on the blogging front, mainly because of the May 1st holiday on Tuesday, but also because I’ve been heads-down on projects I can’t really talk much about.
One thing that does seem worth sharing is an approach we’ve been using to take geometry from Dynamo into Revit. The project itself relates to the use of Generative Design for urban planning. I can’t yet talk about the generative aspect – which is extremely cool – but once the design is basically finalised there’s a need to bring the geometry into Revit.
The ideal scenario would be to place Revit families, where that makes sense, but as a first step it was about bringing across basic solid geometry. Revit has a special Dynamo node that does just this: ImportInstance.ByGeometries. It creates solid geometry inside Revit based on the geometry objects passed in. It doesn’t do anything interesting with 1D and 2D objects, as far as I’ve been able to tell, so I’ve ended up creating a few custom nodes to generate 3D geometry from 1D and 2D objects. For instance, creating a tiny sphere for a point, sweeping a circle along a curve or line to create a tube or cylinder, and thickening surfaces and extruding closed curves. That kind of thing.
The piece I think that’s most valuable, in all this, is the approach taken to control what actually comes across into Revit. Previously we were just specifying certain objects as contributing “preview” graphics: only nodes in the display layer are allowed to generate graphics by having their preview flag set. This meant you could easily work out where to go to toggle their display in the preview.
This worked well enough, but was we started looking at Revit import, it seemed to make more sense to collect the objects together and then allow some selection process to take place. This should give some idea of the approach taken… all the objects that will need to be imported into Revit are gathered into a single code-block. Each entry is mapped to an item in a List.Join node: if we want to exclude a particular set of objects from the import process, we wire in a List.Empty node to replace it. The resultant list gets flattened, scaled (if wanting the results in metres rather than inches) and imported into Revit.
One thing I quickly noticed, once this was in place, was that sometimes we really wanted to switch off preview for everything (especially as the geometry was typically previewed in inches and imported in metres… not a great experience). So I ended up creating a similar group that does exactly the same thing for preview graphics. There’s now only one node in the graph that can be set to preview, which makes disabling preview graphics in their entirety a complete breeze (aside from the control you have over this from the View menu, of course). And it’s much easier to toggle specific objects on and off, too.
Here’s the overall graph… you can see two long horizontal groups – the blue one is for preview graphics, the grey one is for importing geometry into Revit (the right side of which is the above image).
Here’s some sample geometry imported into Revit, to give you a sense of how it looks.
If you have alternative approaches for managing display of – and geometry import from – complex graphs, please post a comment. I’d love to hear how others address this.