Stairs Attributes urgent

Stairs Attributes urgent

Anonymous
Not applicable
265 Views
1 Reply
Message 1 of 2

Stairs Attributes urgent

Anonymous
Not applicable
Hi
I am using Revit with c#.
I want get the elements of the stairs like dimensions, height,width etc.
I can see these in the revit but unable to fetch through c# code.
Will someone please reply as soon as possible it's urgent.
0 Likes
266 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I work with Revit MEP but let see if I can help you.

First I would say create a filter for your stairs

CreationFilter cf = app.Create.Filter;
Filter f1 = cf.NewCategoryFilter(bic);

Next create a List to store the returned stair elements

List<Element> Stairs = new List<Element>();

Then call the active document to get the stairs

Document doc = commandData.Application.ActiveDocument

doc.get_elements(f1, Stairs );

Now you can parse through all of the elements returned for your parameters

Foreach (Element stair in Stairs)
{
foreach (Parameter param in stair.Parameters)
{
string name = param.Definition.Name;
string value = param.AsValueString
}
}


Hope this helps
0 Likes