Esempio n. 1
0
 public static void Insert(IVisualBlock block, Layers.LayerInfo layer = null)
 {
     if (block == null) return;
     var doc = Application.DocumentManager.MdiActiveDocument;
     var db = doc.Database;
     var idBtr = GetInsertBtr(block.Name, block.File, db);
     BlockInsert.Insert(block.Name, layer);
 }
Esempio n. 2
0
 /// <summary>
 /// Переопределенеи блока
 /// </summary>        
 public static void Redefine(IVisualBlock block)
 {
     if (block == null) return;
     var doc = Application.DocumentManager.MdiActiveDocument;
     if (doc == null) return;
     using (doc.LockDocument())
     {
         Block.Redefine(block.Name, block.File, doc.Database);
     }
 }
Esempio n. 3
0
        public static void Insert([CanBeNull] IVisualBlock block, bool explode = false)
        {
            if (block == null)
            {
                return;
            }
            var doc = Application.DocumentManager.MdiActiveDocument;
            var db  = doc.Database;

            GetInsertBtr(block.Name, block.File, db);
            BlockInsert.Insert(block.Name, _layer, explode);
            PluginStatisticsHelper.PluginStart(new CommandStart($"Вставка блока {block.Name}", Assembly.GetCallingAssembly()));
        }
Esempio n. 4
0
        /// <summary>
        /// Переопределенеи блока
        /// </summary>
        public static void Redefine([CanBeNull] IVisualBlock block)
        {
            if (block == null)
            {
                return;
            }
            var doc = Application.DocumentManager.MdiActiveDocument;

            if (doc == null)
            {
                return;
            }
            using (doc.LockDocument())
            {
                Block.Redefine(block.Name, block.File, doc.Database);
            }
        }
Esempio n. 5
0
        private void OnInsertExecute(IVisualBlock block)
        {
            var doc = AcadHelper.Doc;

            using (doc.LockDocument())
            {
                if (IsHideWindow)
                {
                    HideMe();
                    VisualInsertBlock.Insert(block, Explode);
                }
                else
                {
                    using (HideWindow())
                    {
                        VisualInsertBlock.Insert(block, Explode);
                    }
                }
            }
        }
Esempio n. 6
0
 private void OnInsertExecute(IVisualBlock block)
 {
     VisualInsertBlock.Insert(block);
 }