public static void FillPiket(Autodesk.AutoCAD.EditorInput.Editor editor, Table table, Transaction tr, int row) { var piketObj = editor.GetEntity("Выделите Пикет\n"); if (piketObj.Status != Autodesk.AutoCAD.EditorInput.PromptStatus.OK) { throw new Exception(); } var piketStr = tr.GetObject(piketObj.ObjectId, OpenMode.ForRead) as DBText; if (table != null) { table.UpgradeOpen(); table.Cells[row, 0].TextString = piketStr.TextString; } }
private static void ProcessSmallTable(Autodesk.AutoCAD.EditorInput.Editor editor, Table table, Transaction tr, ColumnsCollection columns, int i) { var smallTable = editor.GetEntity("Выделите малую таблицу\n"); if (smallTable.Status != Autodesk.AutoCAD.EditorInput.PromptStatus.OK) { throw new Exception(); } var smallTableObj = tr.GetObject(smallTable.ObjectId, OpenMode.ForWrite, false) as Table; var numOfRow = smallTableObj.Rows.Count; for (int j = 1; j < numOfRow - 4; j++) { if (smallTableObj.Cells[j, 0].TextString != string.Empty) { var grunt = smallTableObj.Cells[j, 0].TextString; var area = smallTableObj.Cells[j, 1].TextString; for (int k = 1; k < columns.Count; k++) { var title = table.Cells[0, k].TextString; var formattedArea = area.Replace(".", ",").Replace("м2", ""); if (title != string.Empty) { if (title == grunt) { table.Cells[i, k].TextString = formattedArea; break; } } else { table.Cells[0, k].TextString = grunt; table.Cells[i, k].TextString = formattedArea; break; } } } } }