public static void GenerateTrainChart()
        {
            // Get the current document and database
            Document acDoc   = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
            Database acCurDb = acDoc.Database;

            // начинаем транзакцию
            using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
            {
                // открываем таблицу блоков документа
                BlockTable acBlkTbl;
                acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;

                // открываем пространство модели (Model Space) - оно является одной из записей в таблице блоков документа
                BlockTableRecord acBlkTblRec;
                acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;

                // открываем таблицу слоев документа
                LayerTable acLyrTbl = acTrans.GetObject(acCurDb.LayerTableId, OpenMode.ForWrite) as LayerTable;


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                // А теперь создаем нужные мне объекты
                ACadWorker          aCadWorker          = new ACadWorker(acCurDb, acTrans, acBlkTblRec, acLyrTbl);
                TrainChartGenerator trainChartGenerator = new TrainChartGenerator(aCadWorker, _fullFileNameWithData);
                trainChartGenerator.Generate();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                // фиксируем изменения
                acTrans.Commit();
            }
        }
 public TrainChartGenerator(ACadWorker aCadWorker, string fullFileName)
 {
     _acadWorker = aCadWorker;
     _fullFileName = fullFileName;
 }
 public TableGenerator(ACadWorker aCadWorker, int rowsNumber)
 {
     _aCadWorker = aCadWorker;
     _rowsNumber = rowsNumber;
 }
Example #4
0
 public ElementMaker(ACadWorker aCadWorker, int y)
 {
     _aCadWorker = aCadWorker;
     _y          = y;
 }
 public SingleLineGenerator(ACadWorker aCadWorker, string line, int y)
 {
     _aCadWorker = aCadWorker;
     _line       = line;
     _y          = y;
 }