Ejemplo n.º 1
0
        public void CreateSetThatDoesntExist()
        {
            Inventor.Application app = ApplicationShim.Instance();
            var      path            = app.DesignProjectManager.ActiveDesignProject.TemplatesPath;
            Document doc             = app.Documents.Add(DocumentTypeEnum.kPartDocumentObject, path + "Standard.ipt", true);

            //try to remove an attributeSet that does not exist.  Will this crash?
            AttributeShim.CreateAttributeSet(doc, "testSet");


            bool result = false;

            foreach (AttributeSet i in doc.AttributeSets)
            {
                if (i.Name.Equals("testSet"))
                {
                    result = true;
                }
            }
            try
            {
                Assert.IsTrue(result);
            }
            finally { doc.Close(true); }
        }
Ejemplo n.º 2
0
        public void CreateSetThatExists_noCrash()
        {
            var doc = tests.TestUtilities.CreatePartDocument();

            //create the test AttributeSet
            AttributeSet attributeSet = doc.AttributeSets.Add("testSet");

            AttributeShim.CreateAttributeSet(doc, "testSet");

            bool result = false;

            foreach (AttributeSet i in doc.AttributeSets)
            {
                if (i.Name.Equals("testSet"))
                {
                    result = true;
                }
            }

            try
            {
                Assert.IsTrue(result);
            }
            finally { doc.Close(true); }
        }
Ejemplo n.º 3
0
        public void CreateSetThatDoesntExist()
        {
            var doc = tests.TestUtilities.CreatePartDocument();

            //try to remove an attributeSet that does not exist.  Will this crash?
            AttributeShim.CreateAttributeSet(doc, "testSet");

            bool result = false;

            foreach (AttributeSet i in doc.AttributeSets)
            {
                if (i.Name.Equals("testSet"))
                {
                    result = true;
                }
            }
            try
            {
                Assert.IsTrue(result);
            }
            finally { doc.Close(true); }
        }