How to get the stairs of runs and landings?

You are going to have to tailor the script to iterate over the input and decide what format that is going to be - say integers or elements

# Check for list
if not hasattr(IN[0], "__iter__"):
    IN[0] = [IN[0]]

# Id integers
stairs_run_elements = [ElementId(item) for item in IN[0]]

# Selected elements
stairs_run_elements = [item.Id for item in UnwrapElement(IN[0])]

Modify parent_stairs.extend(stairs) line as extend is used to join a list (or other iterable) to a list

parent_stairs.append(stairs)

Here are a few links to help you with your Python and Dynamo Forum experience
How to get help on the Dynamo forums
Dynamo Python Primer

and if you haven’t already I would consider an introduction to python course / book
Automate the Boring Stuff with Python
University of Helsinki Python Programming MOOC 2024

1 Like