Revit API

Posts: 3
Registered: ‎09-30-2009
Message 1 of 2 (67 Views)

Stairs Attributes urgent

67 Views, 1 Replies
09-30-2009 05:47 AM
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.
Active Contributor
Posts: 30
Registered: ‎11-25-2008
Message 2 of 2 (67 Views)

Re: Stairs Attributes urgent

09-30-2009 09:10 AM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit