How can get the Floor elevation and Beam elevaton?.

Anonymous

How can get the Floor elevation and Beam elevaton?.

Anonymous
Not applicable

Hello everyone:

 

1. How can get the Floor elevation and Beam elevation?. I need the Double value.
2. How can get the nether elevation the same element (Floor)?

 

get_elevation_1.png

 

Thanks.

 

David

0 Likes
Reply
1,433 Views
2 Replies
Replies (2)

jeremytammik
Autodesk
Autodesk

Dear Frank,

 

I am happy to see that you are using RevitLookup to explore the database.

 

It enables you to answer these question yourself, if you look more closely.

 

In this case, I would suggest something like this:

 

  Floor floor = ... ;
  Level level = doc.GetElement( floor.LevelId ) as Level;
  double elevation = level.Elevation;

 

Good luck!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

Anonymous
Not applicable

Dear Jeremy:

 

Revit RevitLookup is a excellent tools and newly I am learning to use it.

 

About my problem: First I need get Beam Elevation but not works the code. Which I am doing bad?

 

The message:

 

get_elevation_2.png

 

The code:

 

if (category == "Structural Framing")
                {
                    FilteredElementCollector collector = new FilteredElementCollector(m_revit.ActiveUIDocument.Document).OfClass(typeof(FamilyInstance));                    
                   
                    int i = 0;
                    foreach (FamilyInstance fi in collector)
                    {

                        if (fi.StructuralType == StructuralType.Beam)
                        {                            

                            //Get parameter "H" Height
                            Parameter family = fi.LookupParameter("Family");

                            if (family.AsValueString() == "Regular Rectangular Concreto")
                            {

                                //Get parameter "Tipo de Altura"                          
                                Parameter tipoAltura = fi.get_Parameter(new Guid("e9432adc-dbf1-48f2-b34e-20be6ab708e5"));                               

                                //Get parameter "Encofrado"
                                Parameter encofrado = fi.get_Parameter(new Guid("3bfb766d-e81e-4e39-98d0-046a606a17b3"));

                                //Get parameter "z Offset value"
                                Parameter zOffsetValue = fi.LookupParameter("z Offset Value");

                                //Get parameter "Peralte - H"
                                //Parameter H = fi.LookupParameter("H");

                                ElementId elemTypeId = fi.GetTypeId();
                                ElementType myType = (ElementType)m_revit.ActiveUIDocument.Document.GetElement(elemTypeId);

                                Parameter H = myType.LookupParameter("H");

                                //Get level the Beam ;
                                Level level = m_revit.ActiveUIDocument.Document.GetElement(fi.LevelId) as Level;
                                double elevation = level.Elevation;
                                string elevationName = level.Name;                               

                                TaskDialog.Show("GYM-BIM", "Collector = " + fi.Name
                                                + "\nContador = " + i
                                                + "\nId =" + fi.Id
                                                + "\nzOffsetValue =" + ParameterToString(zOffsetValue)
                                                + "\nH =" + ParameterToString(H)
                                                + "\nLevel Value =" + elevation
                                                + "\nLevel Name=" + elevationName
                                 );                                
                                i++;
                            }


                        }

                        if (i == 30)
                        {

                            break;
                        }
                    }                    
                }

 

 

Thanks for your help.

0 Likes