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:
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.