I work with very smart people on a daily basis. That’s a given, because I work on the Dynamo team. Also as an added incentive of my job, when people do deliver cool stuff, I get to write about it. Like, last week, when we delivered Dynamo Studio 0.9.1 to the world.
Release 0.9.1 is huge, literally. The installer size grew twice as big compared to 0.9.0. But that’s not without a good reason — the team added tons of good stuff into it, including (but not limited to) a DWG-import feature, something that Ellensi, Randy and Aparajit worked so hard for.
Since the release I get asked numerous time on how to import a DWG in Dynamo Studio, hopefully this note can shed some light on the matter (thanks Ellensi for helping out with the images). Note that this feature is not available in Dynamo 0.9.1 for Revit, yet.
New nodes for DWG import
New nodes for importing a DWG can be found under Translation
category. More details of each node will be covered in sections below.
Basic whole-file import
The following image illustrates the way to import the entire DWG file into Dynamo Studio, it is the simplest way to import geometries from a given DWG file, but offers no filter on the import. FileLoader
node reads an input DWG file, parsing its contents into a series of ImportedObject
. ConvertToGeometries
node is then used to convert these ImportObject
into actual geometries.
Import geometries through filtering
More fine-grained geometry import can be achieved through the use of the ObjectFilter
node. The ObjectFilter
node takes in either a FileLoader
or a list of ImportedObject
, then outputs a list of ImportedObject
.
The following image shows how to combine multiple conditions in one ObjectFilter
node — any ImportedObject
that satisfies either one of the listed conditions (geometry type is solid or curve) will pass through the filter.
Since an ObjectFilter
node takes in a list of ImportedObject
and outputs a list of ImportedObject
, multiple ObjectFilter
nodes can be chained to perform multi-pass filtering. The following image shows how to get all geometries on layer A-WALL
, before further filtering to get just Sheet
geometries.
Filtering can be based on the following criteria:
- Layer label (i.e. layer name)
- Geometry type
- Diffuse color
- etc.
Import geometries by explicit selection
ObjectSelector
is a new node introduced with DWG-import functionality. It takes in a FileLoader
and display its contents (i.e. ImportedObject
) in a tree view where each ImportedObject
goes under the layer it belongs. Selected ImportedObject
will be returned as a list to downstream nodes.
This node can be used if there are only a handful of geometries to be selected for import. The following image illustrates how object selection can be done:
Chaining of selector and filter nodes
ObjectSelector
outputs a list of ImportedObject
, it can be chained with one or more ObjectFilter
nodes to allow for further filtering. The following image illustrates the way to first filter geometries based on their layer information, then separate them out by their diffuse colors: