I am trying to create a node that can get the xyz vertices of a shape-edited Floor. It would essentially be the opposite of the Clockwork node RoofOrFloor.SlabShapeByPoints, except it only has a single input (Floor) and a single output (Points).
I have used the script from the Clockwork node as a “template,” but so far my script is not doing anything. This is the main part that I am struggling with:
TransactionManager.Instance.EnsureInTransaction(doc)
slabshape.SlabShape.Editor.Enable()
for item in slabshape:
xyzs.append(slabshape.SlabShapeEditor.SlabShapeVertexArray())
TransactionManager.Instance.TransactionTaskDone()
I am fairly new at this, so I’m not sure if I need to do some additional geometry conversion or if I’m not using the RevitApit correctly.
Any help would be greatly appreciated!
Here is the full script:
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
TransactionManager.Instance.EnsureInTransaction(doc)
slabshape.SlabShape.Editor.Enable()
for item in slabshape:
xyzs.append(slabshape.SlabShapeEditor.SlabShapeVertexArray())
TransactionManager.Instance.TransactionTaskDone()
Lauren, I don’t know if you’re using Python for some particular reason.
While I’m sure Dimitar will clarify your Python doubt, just wanted to point out (assuming you aren’t already aware) that the same can be easily done with OOTB nodes
Hi Vikram. I have tried the Element.Geometry node, though for some reason it does not work for me like it does for you. This is why I looked at Python. Are you using a Floor element? That is what I am trying to get the vertices from. Thanks for the suggestion, though.
Good thinking, Vikram. I forgot about the “Topology.Vertices” node.
Lauren, the previous line gives us a list of all of the floor vertices ( https://en.wikipedia.org/wiki/Vertex_(geometry) . The line you highlighted goes through each vertex in the list, extracts its XYZ location and then converts that to a Dynamo point.
Used a floor (Generic 150mm from the default Metric template) with Sub Elements modified (as it seemed like that was your intent ) and one of the more recent Dynamo builds (0.8.3)