Revit API

Revit API

Reply
Contributor
nitin.k
Posts: 25
Registered: ‎04-18-2012
Message 1 of 3 (491 Views)

Fire rating (1Hr, 2Hr.... etc) values for walls.

491 Views, 2 Replies
03-06-2013 01:33 AM

Hi,

 

I am looking for fire rating Value for Walls. i.e. 1Hr, 2 Hr etc.

 

I am able to see these values in "Wall-> Propertices-> Type Propertices" -> Identity data-> Fire Rating

 

But i want to get that value using .net  c# code.

 

Please tell me the method or any way so i get that value.

 

Please help!

 

Regards,

Nitin.

Active Contributor
cshha
Posts: 39
Registered: ‎12-12-2012
Message 2 of 3 (474 Views)

Re: Fire rating (1Hr, 2Hr.... etc) values for walls.

03-06-2013 02:29 PM in reply to: nitin.k

Nitin,

 

You should install an addin called BipChecker, which can be found here

 

http://thebuildingcoder.typepad.com/blog/2013/01/built-in-parameter-enumeration-duplicates-and-bipch...

 

Use this add-in to determine whether the parameter you are trying to access is a Built In Parameter, or a Shared Parameter.  You can also determine whether the parameter is stored as a string, integer, double or ElementId.

 

You can also use RevitLookup, which is an add-in included with the Revit SDK.

 

Element wallElement; (I'm assuming you already have the element available in your code)

FamilyInstance wallFamilyInstance = wallElement as FamilyInstance;

if (wallFamilyInstance != null)

{

//Note that we are accessing wallFamilyInstance.Symbol to access the parameter - this is because it's a type parameter

//If the parameter is a built in parameter, use the following line
Parameter fireRatingParam = wallFamilyInstance.Symbol.get_Parameter(BuiltInParameter.OST_YOURPARAM);

//If the parameter is a shared parameter, use the following line
Parameter fireRatingParam = wallFamilyInstance.Symbol.get_Parameter("Shared Parameter Name");

//Assuming this parameter is an integer. If it's not, use the appropriate type function
int value = fireRatingParam.AsInteger();

}

 

 

 

 

ADN Support Specialist
Joe.Ye
Posts: 334
Registered: ‎03-05-2010
Message 3 of 3 (425 Views)

Re: Fire rating (1Hr, 2Hr.... etc) values for walls.

03-19-2013 08:24 AM in reply to: nitin.k

 

Hi Nitin,

 

The fire rating parameter of wall type is a built-in parameter.

So you can get the parameter value in the way of getting built-in parameter member.

 

Here is the code snippet to show the process.

 

<code>


[TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class RevitCommand1 : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements)
{

UIApplication app = commandData.Application;
Document doc = app.ActiveUIDocument.Document;

Selection sel = app.ActiveUIDocument.Selection;
Reference ref1 = sel.PickObject(ObjectType.Element, "Please pick a wall to get its fire rating");
Wall wall = doc.GetElement(ref1) as Wall;
if (wall == null)
return Result.Failed;

Parameter param = wall.WallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING);

//show the fire rating in task dialog
TaskDialog.Show("Wall type fire rating", param.AsString());

return Result.Succeeded;
}
}

<code>



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.