Example #1
0
 public void OpenIfcFile()
 {
     using (var model = new XbimModel())
     {
         model.CreateFrom("4walls1floorSite.ifc");
         model.Close();
     }
 }
Example #2
0
        public void FileVersionIsCorrect()
        {
            var m = new Xbim.Ifc2x3.IO.XbimModel();

            m.Open("Monolith-NoGeomTables.xBIM", XbimDBAccess.ReadWrite);
            Assert.AreEqual(0, m.GeometrySupportLevel, "GeometrySupportLevel should be 0");
            m.Close();

            m.Open("Monolith_Nogeom_Version1Schema.xBIM");
            Assert.AreEqual(0, m.GeometrySupportLevel, "GeometrySupportLevel should be 0");
            m.Close();

            m.Open("Monolith_v10.xBIM");
            Assert.AreEqual(1, m.GeometrySupportLevel, "GeometrySupportLevel for Monolith_v10 should be 1");
            m.Close();

            m.Open("Monolith_v20.xBIM");
            Assert.AreEqual(2, m.GeometrySupportLevel, "GeometrySupportLevel for Monolith_v20 should be 2");
            m.Close();
        }
Example #3
0
 public void OpenIfcXmlFileFromStream()
 {
     using (var fileStream = new FileStream("4walls1floorSite.ifcxml", FileMode.Open, FileAccess.Read))
     {
         using (var model = new XbimModel())
         {
             model.CreateFrom(fileStream, fileStream.Length, IfcStorageType.IfcXml, "4walls1floorSite.xbim");
             model.Close();
         }
         fileStream.Close();
     }
 }
Example #4
0
        public void OpenIfcXmlFile()
        {
            int percent = 0;
            ReportProgressDelegate progDelegate = delegate(int percentProgress, object userState)
            {
                percent = percentProgress;
            };

            using (var model = new XbimModel())
            {
                model.CreateFrom("4walls1floorSite.ifcxml", null, progDelegate);
                model.Close();
                Assert.IsTrue(percent == 100);
            }
        }
Example #5
0
        public void CanUpgradeDbStucture()
        {
            using (var m = new Xbim.Ifc2x3.IO.XbimModel())
            {
                m.Open(@"Persistency\Monolith_v10.xBIM", XbimDBAccess.Exclusive);
                Assert.AreEqual(1, m.GeometrySupportLevel, "GeometrySupportLevel for Monolith_v10 should be 1");

                var updated = m.EnsureGeometryTables();
                Assert.AreEqual(updated, true, "Should complete returning true");

                m.DeleteGeometryCache();
                Assert.AreEqual(0, m.GeometrySupportLevel,
                                "GeometrySupportLevel for Monolith_v10 should be 0 after removing it.");

                m.Close();
            }
        }
Example #6
0
        public void OpenIfcZipFile()
        {
            int percent = 0;
            ReportProgressDelegate progDelegate = delegate(int percentProgress, object userState)
            {
                percent = percentProgress;
            };

            using (var model = new XbimModel())
            {
                var fileName = Guid.NewGuid() + ".xbim";

                model.CreateFrom("TestZip.ifczip", fileName, progDelegate);
                model.Close();
                Console.WriteLine(percent);
                Assert.IsTrue(percent == 100);
            }
        }