public void GP_BlockSectionTable() { CommandStart.Start(doc => { BlockSection_GP.SectionService ss = new BlockSection_GP.SectionService(doc); ss.CalcSections(); }); }
public void KP_BlockSectionTableFromGP() { CommandStart.Start(doc => { BlockSection_GP.SectionService ss = new BlockSection_GP.SectionService(doc); ss.CalcSectionsForKP(); }); }
/// <summary> /// Построение полилиний контура у блоков Блок-Секций. /// Выбор блоков пользователем. /// </summary> public static void CreateContour(Document doc) { using (var t = doc.TransactionManager.StartTransaction()) { // Выбор блоков SelectSection select = new SelectSection(doc); var selIds = select.Select(false); if (selIds.Count == 0) { throw new Exception("Не найдены блоки Блок-Секций"); } else { doc.Editor.WriteMessage($"\nВыбрано {selIds.Count} блоков Блок-Секций."); } int count = 0; AcadLib.Layers.LayerInfo layInfo = new AcadLib.Layers.LayerInfo("Defpoints"); ObjectId layerIdPl = AcadLib.Layers.LayerExt.GetLayerOrCreateNew(layInfo); ObjectId msId = doc.Database.CurrentSpaceId; foreach (var idBlRefSec in selIds) { var ent = idBlRefSec.GetObject(OpenMode.ForRead) as Entity; if (ent is BlockReference) { var blRefSec = (BlockReference)ent; string blName = blRefSec.GetEffectiveName(); if (SectionService.IsBlockNameSection(blName)) { try { Polyline plLayer; var pl = FindContourPolyline(blRefSec, out plLayer); if (pl != null) { var idPlCopy = pl.Id.CopyEnt(msId); var plCopy = idPlCopy.GetObject(OpenMode.ForWrite, false, true) as Polyline; plCopy.LayerId = layerIdPl; plCopy.TransformBy(blRefSec.BlockTransform); count++; } } catch (Exception ex) { Inspector.AddError($"Ошибка построения контура для блока '{blName}' - {ex.Message}", blRefSec, System.Drawing.SystemIcons.Error); } } } } doc.Editor.WriteMessage($"\nПостроено {count} полилиний контура блоков Блок-Секций."); t.Commit(); } }
public TableSecton(SectionService sectionService) { _service = sectionService; }
} // Плотность м2/га public DataSection(SectionService sectionService) { _service = sectionService; }