예제 #1
0
        public void ByPlane_CanBeUsedToCreateSketchPlaneInFamilyDocument()
        {
            var origin = Point.ByCoordinates(1, 2, 3);
            var normal = Vector.ByCoordinates(0, 0, 1);
            var plane  = Plane.ByOriginNormal(origin, normal);

            var sketchPlane = SketchPlane.ByPlane(plane);

            Assert.NotNull(sketchPlane);
            Assert.NotNull(sketchPlane.Plane);
            Assert.AreEqual(normal, sketchPlane.Plane.Normal);
            Assert.AreEqual(origin, sketchPlane.Plane.Origin);
            Assert.NotNull(sketchPlane.ElementPlaneReference);
        }
예제 #2
0
        public void ByPlane_ValidArgs()
        {
            var origin = Point.ByCoordinates(1, 2, 3);
            var normal = Vector.ByCoordinates(0, 0, 1);
            var plane  = Plane.ByOriginNormal(origin, normal);

            var sketchPlane = SketchPlane.ByPlane(plane);

            Assert.NotNull(sketchPlane);
            Assert.NotNull(sketchPlane.Plane);
            Assert.AreEqual(normal, sketchPlane.Plane.Normal);
            Assert.AreEqual(origin, sketchPlane.Plane.Origin);
            Assert.NotNull(sketchPlane.ElementPlaneReference);
        }
예제 #3
0
        public void ByTextSketchPlaneAndPosition_BadArgs()
        {
            var origin = Point.ByCoordinates(1, 2, 3);
            var normal = Vector.ByCoordinates(0, 0, 1);
            var plane  = Plane.ByOriginNormal(origin, normal);
            var text   = "Snickers - why wait?";

            var name          = "Model Text 1";
            var modelTextType = ModelTextType.ByName(name);

            var sketchPlane = SketchPlane.ByPlane(plane);

            Assert.Throws(typeof(System.ArgumentNullException), () => ModelText.ByTextSketchPlaneAndPosition(null, sketchPlane, 0, 0, 1, modelTextType));
            Assert.Throws(typeof(System.ArgumentNullException), () => ModelText.ByTextSketchPlaneAndPosition(text, null, 0, 0, 1, modelTextType));
            Assert.Throws(typeof(System.ArgumentNullException), () => ModelText.ByTextSketchPlaneAndPosition(text, sketchPlane, 0, 0, 1, null));
        }
예제 #4
0
        public void ByTextSketchPlaneAndPosition_ValidArgs()
        {
            var origin = Point.ByCoordinates(1, 2, 3);
            var normal = Vector.ByCoordinates(0, 0, 1);
            var plane  = Plane.ByOriginNormal(origin, normal);
            var text   = "Snickers - why wait?";

            var name          = "Model Text 1";
            var modelTextType = ModelTextType.ByName(name);

            var sketchPlane = SketchPlane.ByPlane(plane);

            var structure = ModelText.ByTextSketchPlaneAndPosition(text, sketchPlane, 0, 0, 1, modelTextType);

            Assert.NotNull(structure);
            Assert.NotNull(structure.InternalElement);
            Assert.IsTrue(DocumentManager.Instance.ElementExistsInDocument(
                              new ElementUUID(structure.InternalElement.UniqueId)));
        }
예제 #5
0
 public void ByPlane_NullInput()
 {
     Assert.Throws(typeof(System.ArgumentNullException), () => SketchPlane.ByPlane(null));
 }