예제 #1
0
        public void ByNameNumberTitleBlockAndViews_BadArgs()
        {
            ElementBinder.IsEnabled = false;

            var famSymName = "E1 30x42 Horizontal";
            var famName    = "E1 30 x 42 Horizontal";
            var titleBlock = FamilyType.ByFamilyAndName(Family.ByName(famName), famSymName);

            var famTyp  = FamilyType.ByName("Kousa Dogwood - 10'");
            var pt      = Point.ByCoordinates(0, 1, 2);
            var famInst = FamilyInstance.ByPoint(famTyp, pt);

            var pt2      = Point.ByCoordinates(100, 100, 0);
            var famInst2 = FamilyInstance.ByPoint(famTyp, pt2);

            var view  = SectionView.ByBoundingBox(famInst.BoundingBox);
            var view2 = SectionView.ByBoundingBox(famInst2.BoundingBox);

            var sheetName   = "Poodle";
            var sheetNumber = "A1";

            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlockAndViews(null, sheetNumber, titleBlock, new[] { view, view2 }));
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlockAndViews(sheetName, null, titleBlock, new[] { view, view2 }));
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlockAndViews(sheetName, sheetNumber, null, new[] { view, view2 }));
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlockAndViews(sheetName, sheetNumber, titleBlock, null));
        }
예제 #2
0
        public void ByNameNumberTitleBlockViewsAndLocations_ValidArgs()
        {
            ElementBinder.IsEnabled = false;

            var famSymName = "E1 30x42 Horizontal";
            var famName    = "E1 30 x 42 Horizontal";
            var titleBlock = FamilyType.ByFamilyAndName(Family.ByName(famName), famSymName);

            var famTyp  = FamilyType.ByName("Kousa Dogwood - 10'");
            var pt      = Point.ByCoordinates(0, 1, 2);
            var famInst = FamilyInstance.ByPoint(famTyp, pt);

            var pt2      = Point.ByCoordinates(100, 100, 0);
            var famInst2 = FamilyInstance.ByPoint(famTyp, pt2);

            var view  = SectionView.ByBoundingBox(famInst.BoundingBox);
            var view2 = SectionView.ByBoundingBox(famInst2.BoundingBox);

            var location  = Point.ByCoordinates(0, 0, 0);
            var location2 = Point.ByCoordinates(0, 1, 0);

            var sheetName   = "Poodle";
            var sheetNumber = "A1";

            var ele = Sheet.ByNameNumberTitleBlockViewsAndLocations(sheetName, sheetNumber, titleBlock, new[] { view, view2 }, new[] { location, location2 });

            Assert.NotNull(ele);
        }
예제 #3
0
        public void ByFamilyAndName_BadArgs()
        {
            var fam = Family.ByName("Box");

            Assert.Throws(typeof(Exception), () => FamilyType.ByFamilyAndName(fam, "Turtle"));
            Assert.Throws(typeof(System.ArgumentNullException), () => FamilyType.ByFamilyAndName(fam, null));
            Assert.Throws(typeof(System.ArgumentNullException), () => FamilyType.ByFamilyAndName(null, "Turtle"));
        }
예제 #4
0
        public void ByFamilyAndName_GoodArgs()
        {
            var fam    = Family.ByName("Box");
            var famTyp = FamilyType.ByFamilyAndName(fam, "Box");

            Assert.NotNull(famTyp);
            Assert.AreEqual("Box", famTyp.Name);
            Assert.AreEqual("Box", famTyp.Family.Name);
        }
예제 #5
0
        public void ByNameNumberTitleBlock_BadArgs()
        {
            // Arrange
            ElementBinder.IsEnabled = false;

            var famSymName = "E1 30x42 Horizontal";
            var famName    = "E1 30 x 42 Horizontal";
            var titleBlock = FamilyType.ByFamilyAndName(Family.ByName(famName), famSymName);

            var sheetName   = "Poodle";
            var sheetNumber = "A1";

            // Assert
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlock(null, sheetNumber, titleBlock));
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlock(sheetName, null, titleBlock));
            Assert.Throws(typeof(ArgumentNullException), () => Sheet.ByNameNumberTitleBlock(sheetName, sheetNumber, null));
        }
예제 #6
0
        public void ByNameNumberTitleBlock_ValidArgs()
        {
            // Arrange
            ElementBinder.IsEnabled = false;

            var famSymName = "E1 30x42 Horizontal";
            var famName    = "E1 30 x 42 Horizontal";
            var titleBlock = FamilyType.ByFamilyAndName(Family.ByName(famName), famSymName);

            var sheetName   = "Poodle";
            var sheetNumber = "A1";

            // Act
            var ele = Sheet.ByNameNumberTitleBlock(sheetName, sheetNumber, titleBlock);

            // Assert
            Assert.NotNull(ele);
            Assert.AreEqual(sheetName, ele.SheetName);
            Assert.AreEqual(sheetNumber, ele.SheetNumber);
        }