As part of a larger workflow I am trying to extract all rooms and areas from a Revit model into a very dumbed down manner comprising only the volumes of the rooms/areas, or even just their outlines. These will later be processed further in Rhino, which is why I am looking for a method to export geometry (or even lines) from Dynamo do a to a workable file type which can be read in Rhino. What I am trying to export is either an outline of all rooms or 3D geometry of rooms, so very basic information derived from the model.
I’m working with rooms and then their geometry, the same for areas. I found an export to SAT node, I believe this can’t be imported in Rhino though. Are there other packages which I can explore to export to DWG or other formats? I think it can even be just 2D lines but 3D is preferred.
Added clarification to what I am trying to export, and not so much the data exchange from Dynamo to Rhino.
—edit—
A follow up question; can I assign properties to the geometry being created? The room name for example or can each geometry instance be assigned a colour (based on the room name)?
I think you should determine how you want to transfer the data and use it in Rhino first. My suggestion would be to use the Rhino plugin and not even worry about Dynamo.
We briefly discussed this but I don’t recall why wouldn’t work well for us? We will be doing this on a lot of models, one after the other, to build up a database.
I believe Rhythm and or Spring Nodes may have nodes to export to DWG - no idea if this will work as I found chatGPT to not be very good at Dynamo.
A follow up question; can I assign properties to the geometry being created? The room name for example or can each geometry instance be assigned a colour (based on the room name)?
—edit—
It might have been that we can instal plugins, or at least it can be hard for admin to instal something for you, and therefor decided to try and work with what we have/can use.
The plugin is the best way to maintain properties and parameters. I think most other methods just deal with the geometry. Revit already exports to DWG with the native Export function so that seems like the best alternative based on what you’re asking. This is where we are really relying on you to determine what process works best for you and what information is required though. We can’t tell you how you should manage your workflow. If your question is really about how to handle data transfer between Revit and Rhino then you’re probably better off asking in one of those forums first.
I should have been clearer in the OP, the output I am looking for from our models is a very basic volume or set of lines representing a layout of an apartment. We’re dumbing down the Revit data to something very simple and diagramatic. I have my script up to the point where I have geometry within Dynamo that I would like to export into a format readable in Rhino.
It’s not necessarily a Dynamo to Rhino worklfow, it just so happens that the other guy working on this will be using Rhino where he processes the data as a dwg and does something in it with Rhino
Try the native Export to DWG and see where that gets you. I don’t think you’re going to get much in the way of parameters and properties with an export. I think you’d have to use a data transfer method to keep that information.
I don’t think the native export gives me the same granularity as I can get from Dynamo. I can export whole floor plans which is to much informations. With the script I can specify a group I want to work with and make the geometry of all Rooms and Areas in the group.
It doesn’t need to 3D but that would be ideal, also not a problem to lose any data. I can export Room/Areas names/areas etc to excel and the other guy can work with that.
Can the new nodes write geometry to DWG? Unfortunately we’re working with older models (2021 to 2024), if it works however it could be interesting to upgrade some of the projects (very time/resource consuming though).
Time to ditch those 2021 and 2022 models anyway. The typical release cycle is 12 months, which means we’re weeks away form the 2027 products coming out. That means no more security updates for 2022, and 2021 is already 12 months outside of support. Keeping those versions in production is putting the entire business at risk for the benefit of ‘not having to update a model’, a process which should take less than an hour of real work.
That said, I get that you might not be able to do anything about the versions. You do have an obligation to let the the people who can know about risks such as this one, which had a score of 7.8 impacted all versions of Revit so a conservative approach assumes historical impact to unsupported builds. Such patches won’t come out for 2022
Ok… now that that is out of the way.
I think you might find that upgrading to 2025 and doing the export with the new nodes is the best path forward. It’s as simple as getting geometry which can be written to DWG (i.e. lines and solids are a go, polysurfaces are not) and using the node Export Geometry File with a the geometry as one input in the file path as the other. Note that this is a ‘overwrite’ action, so I recommend either planning on using the written DWGs as blocks in the assembled file, or reading the existing content and appending the new geometry to it and leaving annotations and views for a subsequent workflow rather than additive mid stream.
Fortunately the old projects are finished projects or archive projects, the majority of live projects are in 2023 or 2024 and we’re switching to 2025 soon. Its not something I have control over. The script will only be used to open those project, extract the necessary information and move to the next project.
I was able to get a python script (via chatgpt) which works for what I need;
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import os
# Inputs from Dynamo (reordered)
dxf_path = IN[0] # Output DXF filepath
room_curves = IN[1] # List of curve lists (each sublist = curves for one room)
layer_names = IN[2] # List of layer names for each room
# Check if input lists match
if len(room_curves) != len(layer_names):
OUT = "Error: Number of room curve lists must match the number of layer names."
else:
# Open DXF file for writing
with open(dxf_path, "w") as f:
f.write("0\nSECTION\n2\nHEADER\n0\nENDSEC\n")
f.write("0\nSECTION\n2\nTABLES\n0\nENDSEC\n")
f.write("0\nSECTION\n2\nBLOCKS\n0\nENDSEC\n")
f.write("0\nSECTION\n2\nENTITIES\n")
# Loop through each room's curves and write them to the DXF
for i, curves in enumerate(room_curves):
layer = layer_names[i] # Get the layer name for this room
for curve in curves:
if isinstance(curve, Line):
start = curve.StartPoint
end = curve.EndPoint
f.write(f"0\nLINE\n8\n{layer}\n10\n{start.X}\n20\n{start.Y}\n30\n{start.Z}\n")
f.write(f"11\n{end.X}\n21\n{end.Y}\n31\n{end.Z}\n")
elif isinstance(curve, PolyCurve): # Handle PolyCurves
for seg in curve.Curves():
start = seg.StartPoint
end = seg.EndPoint
f.write(f"0\nLINE\n8\n{layer}\n10\n{start.X}\n20\n{start.Y}\n30\n{start.Z}\n")
f.write(f"11\n{end.X}\n21\n{end.Y}\n31\n{end.Z}\n")
f.write("0\nENDSEC\n0\nEOF\n")
OUT = dxf_path # Return file path
Quick testing this seems to work. I will have to work on the script to run it on more than one set of rooms and areas but that shouldn’t be to bad to get working.