Spiral Stair Geometry in Dynamo


How to create spiral stair geometry from Revit element in dynamo?
that above picture Dynamo can’t crate that.
Thank a lot .

Hello,

You mean that?
(by the way close the workmode! than Dynamo will run perfectly)

Yes but stair created by cast in place type can’t get geometry. T T
my purpose is get volume of concrete from that.

True, it is even not in schedules. We model our stairs as GenericModel because of 3D/2D representation. It is in a simple way better.
For taging we use 1mm stair, that is on Auxilery Workset.

It’s good choice. :smiley: :smiley:
Thank for your recommend.

Hi @peerawit.ru ,

You can acquire the Solids of the GeometryInstances that makes up the stair, and from there get the Volume. It does require API calls through Python though.

Here’s an example:

Python script:

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

def convertfrominternal(val):
	return UnitUtils.ConvertFromInternalUnits(val, DisplayUnitType.DUT_CUBIC_METERS)

stair = UnwrapElement(IN[0])

opts = Options()
opts.ComputeReferences = True

geom = stair.get_Geometry(opts)

output = []

for i in geom:
	solids_lst = i.GetInstanceGeometry()
	temp = []
	for j in solids_lst:
		temp.append(j.Volume)
	output.append(sum(temp))

OUT = convertfrominternal(sum(output))

Mind that I’m converting this to cubic meters, as this OOTB, comes out in imperial units if not converted.

Can i convert Revit.DB.GeometryInstance to Solid in Dynamo?
I want to find separate face area from solid for defindes something.
thank a lot.

Something like this maybe?

Python Script:

import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import ToDSType(bool) extensions method
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

def convertfrominternal(val):
	return UnitUtils.ConvertFromInternalUnits(val, DisplayUnitType.DUT_CUBIC_METERS)

stair = UnwrapElement(IN[0])

opts = Options()
opts.ComputeReferences = True

geom = stair.get_Geometry(opts)

output = []

for i in geom:
	#output.append(i.GetInstanceGeometry())
	solids_lst = i.GetInstanceGeometry()
	temp = []
	for j in solids_lst:
		faces = j.Faces
		for f in faces:
			if f.Area > 0:
				edgeLoops = f.EdgeLoops
				temp2 = []
				for edges in edgeLoops:
					for e in edges:
						temp2.append(e.AsCurve().ToProtoType())
					temp.append(temp2)
		output.append(temp)


OUT = output

Edit: We can’t turn the Revit API solids into Dynamo solids using the ProtoType() method. It will fail the same way as the Element.Geometry node. I don’t have a better answer, then to recreate the geometry from Edges extracted from the Revit API Solids. Maybe someone with more knowledge about this could supply a better answer :slight_smile:

That all i want.
finally i can create solid from spiral stair
Thank a lot .

Lovely :slight_smile:

No probs :ok_hand:

For dynamo in year 2026, the script as-is was not running as intended, probably due to currently dynamo preferring pythonnet3. Or something else, I am not that proficient in dynamo.

However, changing line 9 to:

return UnitUtils.ConvertFromInternalUnits(val, UnitTypeId.CubicMeters)

made the python run as intended.

What you have highlighted is technically a issue in relation to Units api that changed around revit 2021, which then the previous version was removed from the later versions of revit. Why you have to place in UnitTypeId instead of DisplayUnitType.

The old office hour which might be relevant to spiral stairs, though not technical “stairs” in the traditional Revit sense: https://youtu.be/VMG30VNpyYg?list=PLdlF7MirPEC2yNFTGymESd3t7Xosfk9c2&t=2047