/// <summary> /// Checks if id corresponds to a valid <see cref="Autodesk.Revit.DB.BuiltInCategory"/> id. /// </summary> /// <param name="id"></param> /// <param name="builtInCategory"></param> /// <returns></returns> public static bool TryGetBuiltInCategory(this ElementId id, out BuiltInCategory builtInCategory) { builtInCategory = (BuiltInCategory)id.IntegerValue; if (builtInCategory.IsValid()) { return(true); } builtInCategory = BuiltInCategory.INVALID; return(false); }