Just wondering if it is possible to use points from Rhino and a Floor from Revit and add those points to the Revit floor using GHPython button in Gh with RiR? I think that I am on the right track, but I also think I must be missing a couple of lines since when I flip the boolean switch, nothing happens. I have used this same code in the Python button in Dynamo with the transaction manager to do the same over there, but I don’t know if that is required in Grasshopper RiR or how to correctly obtain the document to even do that. Here’s what I have so far for the code after all of the boilerplate code and using the Revit baking code from Sample7.py:
for pt in x:
newfloor2 = doc.GetElement(z.UniqueId)
slabshapeedit = newfloor2.SlabShapeEditor()
if y == True:
x are the points
y is the boolean switch
z is the floor
You’ve got to make sure the points are in the boundary and face of the floor element. Otherwise Revit API will silently skip them. See the files below. Rhino file contains the points, Revit model contains the floor, and the grasshopper contains the python script
Hi, I have been getting this error while using this script. Is it something to do with the particular floor element that I’m selecting? Edit: This error is appearing, after the script solves, on the “Geomeric Element” button that contains the referenced floor object in Revit.
This object was expired because it contained obsolete Revit elements.
Also . … @kike do you know why this error is being thrown (making the script fail)?
To close this loop, I figured out how to fix the issue, even though I don’t know exactly why this is an issue. The units in the Rhino file were Inches. I changed them to Feet, clicking Yes to scale everything, and then it worked just fine.
No problem Ctu6, in general when trying to figure out a new workflow in Revit API (which is what Rhino.Inside.Revit is doing) is to go through the steps in Revit UI. Then figure out what you would need to do to that programmatically.
In a sloped ceiling for instance you would need to edit the shape, cycle though the boundary curves, select a particular one and assign it as sloped (and how that would be determined by a user in GH), then assign a slope angle.
Once a rough idea is set out I then look at the Revit API methods to what’s possible and what other users have done (Revit Developer forums/ Dynamo etc) to determine if it’s possible, what the obstacles are and if it’s worth scripting.