Our office is using Rhino for design and Revit for documentation. I am developing a workflow to add Revit Windows in a Revit wall, using a window centerline (curve) placed across a corresponding wall in Rhino. These centerlines have user attributes (“Family Name” and “Rough Opening”) which are queried in GH to select the correct Revit window Family and Type, as well as a “sill height” attribute used to set the Sill Height parameter in Revit and a Level attribute to set the correct Revit Level. This is all mostly working properly, but I have a few key problems, described below. I am curious to hear general feedback on this approach, also.
I am running Revit 2024, Rhino 7 and latest WIP Rhino.Inside.Revit.
My project files:
https://www.dropbox.com/t/okaoCEsb28VvyrNX
For anyone who doesn’t want to download the files, I have attached screengrabs of my full GH script at the end of the post.
Window centerlines with attributes
Problem 1:
The key piece I am struggling with is the Location parameter.
I am attempting to set the Location of the Revit window using a point, generated from the intersection of the Revit wall curve and the Rhino window centerline curves placed by the designer.
This works in a simple use case but where it gets complicated is in the transform between the model space of the Revit and Rhino models. Our Revit model is in a Survey Point (shared) coordinate system (at actual elevation above sea level). There is also a project base point in the Revit model, which is equivalent to the 0,0,0 origin (Project Basepoint) of our Rhino model. So I have to use a Plane to Plane Transform whenever sending geometry back and forth, except when simply placing families, via the Add Component (Location) workflow, in which case I can just adjust the location according to the Z-difference between the two coordinate systems. See this screenshot, where Revit wall curves are coming in at 2810.786359’ above the Rhino model, while the Rhino project is down at 0,0,0 plane:
In other words, to find the intersection between the Revit wall curves–which are at three Levels starting at z=2810.786359’ and moving up–and the Rhino window centerline curves–which will be at or near z=0’–I have to project both sets of curves to the same plane. I have chosen to project both sets of curves to the 0,0,0 plane, allowing the intersections to be calculated.
Intersection of window centerline curve and wall curve, both projected to 0,0,0 plane
But now I have to send these intersection points back up to their respective Revit wall curves (at Revit Level 1, Level 2, and Level 3; 2810.786359’ and higher in the Rhino space), because Revit needs the Location point to be within a certain tolerance of Z-axis distance from the host wall curve for it to recognize it as a location for inserting hosted element. How should I handle this more elegantly? I don’t currently have a solution for automating sending each intersection point back to the wall curve it belongs to. Currently I am manually typing in the exact height for this final transform of the Location point (2810.786359’ + elevation of specific base level of wall in question).
–
Problem 2:
Another problem is that Revit seems to project the Location point to all walls in the list, rather than requiring that the Location point actually intersect or touch the wall curve (in the X and Y dimensions) of a potential Host. You can see that in the image below, where a single point results in a window in all four walls which would intersect with a line drawn perpendicular to the point (perpendicular to the X,Y axes). Is there any way to change or control this Revit behavior?
If there isn’t any way around this, how can I manage my data trees to pair up walls with their respective insertion location points when using the Add Component (Location) script? I have basic skill with Path Mapper and related tools, but I can’t visualize the logic needed here.
–
Problem 3:
I am trying to feed the Level parameter of the Add Component (Location) script by querying the Level value from the User Attribute of the Rhino window centerline element (see above). This way I will automate assigning the proper Level value to each window from the value entered by the designer in the properties of the window centerline in Rhino.
Querying the Level value from the User Attribute
The problem is I can’t understand how, using Rhino.Inside.Revit filters or whatever method of querying elements, to take this text element (e.g. “Level 3”) from the User Attribute and use it to query Level 3 in Revit and send that as a Level element to the Add Component script.
[23 1110 Rhino Model for Forum Post.3dm|attachment]
Aborted attempt to use this User Value to query a Revit Level and feed it into the Add Component (Location) script.
I can’t figure out the correct way to do this.
–
Thanks in advance
Full script: