public void GetAllPlanesTest() { List <FloorArchitect> floorsAr; string testFile = @"c:\temp\test\АКР\Base\Tests\Тест-ПостроениеФасада.dwg"; using (var db = new Database(false, true)) { db.ReadDwgFile(testFile, FileOpenMode.OpenForReadAndAllShare, false, ""); db.CloseInput(true); using (AcadLib.WorkingDatabaseSwitcher dbSwitcher = new AcadLib.WorkingDatabaseSwitcher(db)) { BaseService baseService = new BaseService(); baseService.InitToCreationPanels(db); floorsAr = FloorArchitect.GetAllPlanes(db, baseService); } db.SaveAs(@"c:\temp\test\АКР\Base\Tests\Тест-ПостроениеФасада-WindowMarks.dwg", DwgVersion.Current); } Assert.AreEqual(floorsAr.Count, 2); }
public void CreateFacadeTest() { Inspector.Clear(); var docTest = Application.DocumentManager.MdiActiveDocument; var db = docTest.Database; baseService.ClearPanelsAkrFromDrawing(db); // Подготовка - копирование блоков, слоев, стилей, и т.п. baseService.InitToCreationPanels(db); // Определение фасадов List <FacadeMounting> facadesMounting = FacadeMounting.GetFacadesFromMountingPlans(); List <FloorArchitect> floorsAr = FloorArchitect.GetAllPlanes(db, baseService); // Создание определений блоков панелей по базе baseService.CreateBtrPanels(facadesMounting, floorsAr); //Создание фасадов FacadeMounting.CreateFacades(facadesMounting); //Восстановление ассоциативной штриховки в дин блоках сечений using (var t = db.TransactionManager.StartTransaction()) { var secBlocks = baseService.Env.BlPanelSections; foreach (var item in secBlocks) { item.ReplaceAssociateHatch(); } t.Commit(); } if (Inspector.HasErrors) { Inspector.Show(); } }