示例#1
0
        public void ByCurveAndLevels_ShouldCreateGeometricallyCorrectWall()
        {
            var elevation = 100;
            var line      = Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 100), Point.ByCoordinates(10, 10, 100));
            var level0    = Level.ByElevation(elevation);
            var level1    = Level.ByElevation(elevation + 100);
            var wallType  = WallType.ByName("Curtain Wall 1");

            var wall = Wall.ByCurveAndLevels(line, level0, level1, wallType);

            wall.BoundingBox.MinPoint.Z.ShouldBeApproximately(elevation);
        }
示例#2
0
        public void ByCurveAndLevels_NullArgs()
        {
            var elevation = 100;
            var line      = Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(10, 10, 0));
            var level0    = Level.ByElevation(elevation);
            var level1    = Level.ByElevation(elevation + 100);
            var wallType  = WallType.ByName("Curtain Wall 1");

            Assert.Throws(typeof(ArgumentNullException), () => Wall.ByCurveAndLevels(null, level0, level1, wallType));
            Assert.Throws(typeof(ArgumentNullException), () => Wall.ByCurveAndLevels(line, null, level1, wallType));
            Assert.Throws(typeof(ArgumentNullException), () => Wall.ByCurveAndLevels(line, level0, null, wallType));
            Assert.Throws(typeof(ArgumentNullException), () => Wall.ByCurveAndLevels(line, level0, level1, null));
        }
示例#3
0
        public void ByCurveAndLevels_ValidArgs()
        {
            // prevent rebinding when creating levels
            ElementBinder.IsEnabled = false;

            var elevation = 100;
            var line      = Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 100), Point.ByCoordinates(10, 10, 100));
            var level0    = Level.ByElevation(elevation);
            var level1    = Level.ByElevation(elevation + 100);
            var wallType  = WallType.ByName("Curtain Wall 1");

            var wall = Wall.ByCurveAndLevels(line, level0, level1, wallType);

            Assert.NotNull(wall);
        }