Hello, I have the following code:
public static void HandleStairs(Document doc) List<TransitionPoint> ret = new List<TransitionPoint>(); FilteredElementCollector collector = new FilteredElementCollector(doc); ICollection<Element> stairs = collector.OfCategory(BuiltInCategory.OST_Stairs).ToElements(); foreach (var stair in stairs) { var st= stair as Stairs; if(st!=null) { %code that is never executed } } return ret; }
Now the problem is that no matter what the stairs seem to always be zero, I heard that another programmer had the same problem.
a stair variable gets several objects with stair properties (called a staircase that has risers and ext. platforms), but it doesn't really seem like they are being taken to the stairs. Does anyone know how to actually drop this onto a ladder (or else get all the ladders in a document?)
Please note that the staircase is an element with the following properties:
Riser to Tread Connection Monolithic Material Apply Nosing Profile Stringer Material Text Size Begin with Riser Stringer Carriage Height URL Open Stringer Offset Right Stringer Riser Type Cost Left Stringer Underside of Winder Stringer Height Nosing Profile Manufacturer Middle Stringers Keynote Riser Material Minimum Tread Depth Text Font Monolithic Stairs Maximum Riser Height Landing Carriage Height Break Symbol in Plan Landing Overlap Extend Below Base Nosing Length Assembly Description End with Riser Description Function Type Image Type Comments Stringer Thickness Assembly Code Calculation Rules Trim Stringers at Top Model Tread Thickness Tread Material Riser Thickness
I mainly need staircase objects to get runs associated with staircase objects, or actually I need the paths that the runs follow.
You can hopefully use the following:
var tesselated = new List<XYZ>(); var stairPath = run.GetStairsPath(); foreach (Curve curve in stairPath) { tesselated.AddRange(curve.Tessellate()); }
Because I need XYZ places for the positions of any stairs attached to the geometry of the building.
source share