Get stair railing path

Hi

I’m trying to get a stair’s railing path. I have a Python script which works for a single stair but it doesn’t work for a list of stairs. Any ideas on how I need to modify it? Sorry I’m a Python noobie…

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

curves = []
railing = UnwrapElement(IN[0])
rpath = railing.GetPath()

for i in rpath:
	curves.append(i.ToProtoType())

OUT = curves

Thanks

Hi @Paul_Wintour

Is this what your looking for?

3 Likes

?

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

curves = []
railing = UnwrapElement(IN[0])
for r in railing:
	step2=r.GetPath()
	for s in step2:
		curves.append(s.ToProtoType())
OUT = curves
1 Like

@Kulkul That’s it. Can you share please.

@Ewan_Opie

Which version of Dynamo/Revit are you on? I’m on Revit 2018 and Dynamo 1.3 and ‘element.geometry’ doesn’t work for me on a railing.

@Paul_Wintour Here is the file For PaulWintor (Railing).dyn (3.9 KB). Please mark the post as solved. You’re welcome!

6 Likes

Perfect. Thank you!

Paul, I am curious why you were trying to grab the path… can you share what you’re trying to do? I cam e across your question because I’m trying to automatically place a volume (to act as a height clearance, no fly zone)…

have you seen this?

I was getting the railing to work out the clearance between handrails. If you want to calculate the head clearance, you’ll need to get the treads and nosings.

I know what the required head clearance is, but in this case, since we work as part of a multidisciplinary team, we try to create 3D clearance zones to tell other disciplines to keep their pipes out of these areas…

Marcel, no I haven’t seen it. Thanks for sharing. I think we are going for something different though… When I get around to it, I will use the python script extracting the path of the railing to automate drawing draw another face based massing volume…we want to visualize a no fly zone so that other disciplines don’t route their pipes within the head clearances allowed (typically 6’8" min.)

: grinning: it gives the same (z coordinate value) even on stairs. Start point and End point at the stairs have the same elevation?