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: 

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

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
1756 Views, 2 Replies

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

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.

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

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();

}

 

 

 

 

Message 3 of 3
Joe.Ye
in reply to: Anonymous

 

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

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