Ejemplo n.º 1
0
        // Вставка таблицы
        public void Insert()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
             Database db = doc.Database;
             Editor ed = doc.Editor;

             Table table;
             if (_rooms.GroupBy(r=>r.Ws.Section).Count()>1)
             {
            SectionTable st = new SectionTable(_rooms);
            table = st.GetTable();
             }
             else
             {
            RoomTable rt = new RoomTable(_rooms);
            table = rt.GetTable();
             }

             TableJig jigTable = new TableJig(table, 1 / db.Cannoscale.Scale, "Вставка таблицы");
             if (ed.Drag(jigTable).Status == PromptStatus.OK)
             {
            using (var t = db.TransactionManager.StartTransaction())
            {
               //table.ScaleFactors = new Scale3d(100);
               var cs = db.CurrentSpaceId.GetObject(OpenMode.ForWrite) as BlockTableRecord;
               cs.AppendEntity(table);
               t.AddNewlyCreatedDBObject(table, true);
               t.Commit();
            }
             }
        }
Ejemplo n.º 2
0
        // вставка итоговой таблицы расхода плитки на альбом
        public void InsertTableTotalTile()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            // подсчет итогового кол плитки
            Table table = getTable(db);

            TableJig jigTable = new TableJig(table, 100, "\nВставка итоговой таблицы плитки на альбом");
            if (ed.Drag(jigTable).Status == PromptStatus.OK)
            {
                using (var t = db.TransactionManager.StartTransaction())
                {
                    //table.ScaleFactors = new Scale3d(100);
                    var cs = db.CurrentSpaceId.GetObject(OpenMode.ForWrite) as BlockTableRecord;
                    cs.AppendEntity(table);
                    t.AddNewlyCreatedDBObject(table, true);
                    t.Commit();
                }
            }
        }
Ejemplo n.º 3
0
      private void insertTable(Table table)
      {
         Database db = Doc.Database;
         Editor ed = Doc.Editor;

         TableJig jigTable = new TableJig(table, 1 / db.Cannoscale.Scale, "Вставка таблицы");
         if (ed.Drag(jigTable).Status == PromptStatus.OK)
         {
            var cs = db.CurrentSpaceId.GetObject(OpenMode.ForWrite) as BlockTableRecord;
            cs.AppendEntity(table);
            db.TransactionManager.TopTransaction.AddNewlyCreatedDBObject(table, true);
         }
      }
Ejemplo n.º 4
0
 private void insertTable(Table table)
 {
     double scale = db.TileMode ? 1 / db.Cannoscale.Scale : 1;
     TableJig jigTable = new TableJig(table, scale, "Вставка спецификации кондиционеров");
     if (ed.Drag(jigTable).Status == PromptStatus.OK)
     {
         var cs = db.CurrentSpaceId.GetObject(OpenMode.ForWrite) as BlockTableRecord;
         cs.AppendEntity(table);
         db.TransactionManager.TopTransaction.AddNewlyCreatedDBObject(table, true);
     }
 }