Revit API

Reply
Member
ritishrocky1
Posts: 3
Registered: ‎09-30-2009
Message 1 of 2 (69 Views)

Stairs Attributes urgent

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

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.