示例#1
0
        public void ByName_ValidArgs()
        {
            var name          = "24\" Arial";
            var modelTextType = ModelTextType.ByName(name);

            Assert.NotNull(modelTextType);
            Assert.AreEqual(name, modelTextType.Name);
            Assert.IsTrue(DocumentManager.Instance.ElementExistsInDocument(
                              new ElementUUID(modelTextType.InternalElement.UniqueId)));
        }
示例#2
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));
        }
示例#3
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)));
        }
示例#4
0
 public void ByName_BadArgs()
 {
     Assert.Throws(typeof(ArgumentNullException), () => ModelTextType.ByName(null));
     Assert.Throws(typeof(Exception), () => ModelTextType.ByName("turtle type"));
 }