How to get information about the stairs using Revit API?
I have a multiple floor building having stairs in it, but I am unable to get the stairs information using Revit API.
Method i am using to get the stairs information:
----------------------------------------------------------------------------------------------------------
public static void Save(ElementSet stairs)
{
try
{
DataSet dsStairs = BALStairs.GetStairs(BOCommon.ProjectId);
foreach (Element tempStairs in stairs)
{
DataRow drCurrent = dsStairs.Tables["Stairs"].NewRow();
//get the levels for the stairs.
if (tempStairs.Level != null && BOCommon.ProjectId != -1)
{
BALRoom.GetLevelId(BOCommon.ProjectId, tempStairs.Level.Name);
}
//inserted on 20 oct
if (BOCommon.ProjectId != -1)
drCurrent["ProjectId"] = BOCommon.ProjectId;
if (BOCommon.LevelId != -1)
drCurrent["LevelId"] = BOCommon.LevelId;
if (BOCommon.ProjectId != -1)
drCurrent["ProjectId"] = BOCommon.ProjectId;
if (BOCommon.LevelId != -1)
drCurrent["LevelId"] = BOCommon.LevelId;
string famName;
try
{
//assiging the values of the stairs elements to null.
drCurrent["TopLevel"] = DBNull.Value;
drCurrent["BaseLevel"] = DBNull.Value;
drCurrent["ActualNumRiser"] = DBNull.Value;
drCurrent["ActualRiserHeight"] = DBNull.Value;
drCurrent["TreadWidth"] = DBNull.Value;
drCurrent["TreadDepth"] = DBNull.Value;
drCurrent["Name"] = DBNull.Value;
drCurrent["TypeName"] = DBNull.Value;
drCurrent["FamilyName"] = DBNull.Value;
-----------------------------------------------------------------------------------------------------
But API returns the emply value for stairs.
Please review and send us the valuable feedback.
Thanks,