Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stairs Attributes urgent

1 REPLY 1
Reply
Message 1 of 2
ritishrocky1
197 Views, 1 Reply

Stairs Attributes urgent

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.
1 REPLY 1
Message 2 of 2
joelkarr
in reply to: ritishrocky1

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community