예제 #1
0
        public void ByAreaSchemeName_NullArgs()
        {
            var areaScheme = new Autodesk.Revit.DB.FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument)
                             .OfCategory(Autodesk.Revit.DB.BuiltInCategory.OST_AreaSchemes)
                             .Select(x => x.ToDSType(true))
                             .FirstOrDefault();

            Assert.IsNotNull(areaScheme);

            Assert.Throws(typeof(ArgumentNullException), () => ScheduleView.CreateAreaSchedule(null, "AreaSchedule_Test"));
            Assert.Throws(typeof(ArgumentNullException), () => ScheduleView.CreateAreaSchedule(areaScheme, null));
        }
예제 #2
0
        public void ByAreaSchemeName_ValidArgs()
        {
            var areaScheme = new Autodesk.Revit.DB.FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument)
                             .OfCategory(Autodesk.Revit.DB.BuiltInCategory.OST_AreaSchemes)
                             .Select(x => x.ToDSType(true))
                             .FirstOrDefault();

            Assert.IsNotNull(areaScheme);

            var view = ScheduleView.CreateAreaSchedule(areaScheme, "AreaSchedule_Test");

            Assert.NotNull(view);

            Assert.IsTrue(DocumentManager.Instance.ElementExistsInDocument(
                              new ElementUUID(view.InternalElement.UniqueId)));
        }