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:
def CommitToDocument(doc):
for pt in x:
newfloor2 = doc.GetElement(z.UniqueId)
slabshapeedit = newfloor2.SlabShapeEditor()
slabshapeedit.DrawPoint(pt.ToXyz())
if y == True:
Revit.EnqueueAction(Action[Document](CommitToDocument))
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.
I’m currently doing material takeoff and finishing drawings for a 2000+ rooms project as other thread had described, about 60+stairs I think.
All in a sudden a request is to bulid ceilings and floors corresponding to stairs’ geometry, top and bottom. Apparently the project surface of bounding area not satisfied enoung for them.
The ‘Add points to Floor’ script I had tried and used, worked. But “they” want the floor surface exactly matches stairs’ stpe to nose… for that part I’ll try “socialize” that out tomorrow, if fortune.
Then i start thing about the bottom part of stair, which is ceiling in terms of room (with a slope). And that’s why I’m wondering if the current RIR can do something to make it happen.
This is a pretty particular workflow, how do you propose making this happen in the RiR environment? Not seeing anything in the API for the actual ceiling sketch.
@Japhy Don’t know if its something possible;
For a flat ceiling the Slope parameter is read-only, once Defines Slope is check, it can then be modified through RiR.