import bpy import math # This will remove all the objects. Did we really need to? # It's handy if we're going to run this a bunch of times bpy.ops.object.select_all(action='SELECT') # Default action is TOGGLE bpy.ops.object.delete() for stair in range(1, 10): center = (0, stair * 2, stair) bpy.ops.mesh.primitive_cube_add(location=center) new_stair = bpy.context.active_object new_stair.scale = (2, 2, 0.5) for stair in range(1, 10): center = (0, -stair * 2, stair) bpy.ops.mesh.primitive_cube_add(location=center) new_stair = bpy.context.active_object new_stair.scale = (2, 2, 0.5) for stair in range(1, 10): center = (0, -(10 - stair) * 2, stair + 9) bpy.ops.mesh.primitive_cube_add(location=center) new_stair = bpy.context.active_object new_stair.scale = (2, 2, 0.5) for stair in range(1, 10): center = (0, (10 - stair) * 2, stair + 9) bpy.ops.mesh.primitive_cube_add(location=center) new_stair = bpy.context.active_object new_stair.scale = (2, 2, 0.5)