Пример #1
0
        public static void AddEntityWithTransaction()
        {
            Transaction transaction = HostApplicationServices.WorkingDatabase.TransactionManager
                                      .StartTransaction();
            Line line = new Line(new Point3d(0, 0, 0), new Point3d(1, 1, 0));

            DrawingSpace.AddEntity(line, transaction);

            // Since the transaction is still open we can continue to manipulate the object
            // and get access to properties that are set only after adding it to the database.
            line.Color = Color.FromColorIndex(ColorMethod.ByAci, 1);
            transaction.Commit();
        }
Пример #2
0
        public static void AddEntity()
        {
            Line line = new Line(new Point3d(0, 0, 0), new Point3d(1, 1, 0));

            DrawingSpace.AddEntity(line);
        }