public void ClearAllScheduleFilters_ValidArgs() { var rView = new Autodesk.Revit.DB.FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument) .OfClass(typeof(Autodesk.Revit.DB.ViewSchedule)) .Cast <Autodesk.Revit.DB.ViewSchedule>() .FirstOrDefault(x => x.Name == "Wall Schedule"); var view = ScheduleView.FromExisting(rView, true); Assert.NotNull(view); // remove all schedule filters view.ClearAllFilters(); Assert.AreEqual(view.ScheduleFilters.Count, 0); }
public static ScheduleView Wrap(Autodesk.Revit.DB.ViewSchedule view, bool isRevitOwned) { return(ScheduleView.FromExisting(view, isRevitOwned)); }
public void BySheetScheduleLocation_EmptySchedule() { var sheet = new FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument) .OfClass(typeof(ViewSheet)) .Where(x => x.Name.Equals("Unnamed")) .First() as ViewSheet; var scheduleView = new FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument) .OfClass(typeof(Autodesk.Revit.DB.ViewSchedule)) .Where(x => x.Name.Equals("Room Schedule")) .First() as ViewSchedule; var location = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0); var expectedExceptionMessage = Revit.Properties.Resources.EmptySchedule; var exceptionScheduleOnSheet = Assert.Throws <InvalidOperationException>(() => ScheduleOnSheet.BySheetScheduleLocation(Sheet.FromExisting(sheet, true), ScheduleView.FromExisting(scheduleView, true), location)); Assert.AreEqual(expectedExceptionMessage, exceptionScheduleOnSheet.Message); }
public void BySheetScheduleLocation() { var sheet = new FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument) .OfClass(typeof(ViewSheet)) .Where(x => x.Name.Equals("Unnamed")) .First() as ViewSheet; var scheduleView = new FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument) .OfClass(typeof(Autodesk.Revit.DB.ViewSchedule)) .Where(x => x.Name.Equals("View List")) .First() as ViewSchedule; var location = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0); var scheduleOnSheet = ScheduleOnSheet.BySheetScheduleLocation(Sheet.FromExisting(sheet, true), ScheduleView.FromExisting(scheduleView, true), location); Assert.AreEqual("View List", scheduleOnSheet.Name); }