예제 #1
0
        public void GetExisting_works()
        {
            var doc = tests.TestUtilities.CreatePartDocument();

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

            Inventor.Attribute attribute = attributeSet.Add("testAttribute", ValueTypeEnum.kStringType, test);

            var result = AttributeShim.GetAttributeValue(doc, "testSet", "testAttribute");

            try
            {
                Assert.AreEqual(result, test);
            }
            finally { doc.Close(true); }
        }
예제 #2
0
        public void GetExisting_works()
        {
            Inventor.Application app = ApplicationShim.Instance();
            var      path            = app.DesignProjectManager.ActiveDesignProject.TemplatesPath;
            Document doc             = app.Documents.Add(DocumentTypeEnum.kPartDocumentObject, path + "Standard.ipt", true);


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

            Inventor.Attribute attribute = attributeSet.Add("testAttribute", ValueTypeEnum.kStringType, test);


            var result = AttributeShim.GetAttributeValue(doc, "testSet", "testAttribute");


            try
            {
                Assert.AreEqual(result, test);
            }
            finally { doc.Close(true); }
        }