コード例 #1
0
        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);
        }
コード例 #2
0
 public static ScheduleView Wrap(Autodesk.Revit.DB.ViewSchedule view, bool isRevitOwned)
 {
     return(ScheduleView.FromExisting(view, isRevitOwned));
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }