Identify the block editing mode in AutoCAD

By Virupaksha Aithal

In last couple of weeks we have received quires related to identifying the block editing state in AutoCAD. One approach to identify the state is to read the system variable “BLOCKEDITOR” using GetSystemVariable in .NET or using acedGetVar in ObjectARX. BLOCKEDITOR will be 1 if you are in block editing mode.


Comments

4 responses to “Identify the block editing mode in AutoCAD”

  1. Not acedGetSym but acedGetVar.

  2. Hi Alexander,
    Thanks for pointing out. The blog is corrected now.
    regards
    Viru

  3. Hi Virupaksha!
    And what about to know the name of block which is editing in BEDIT command? For REFEDIT command there is REFEDITNAME system variable, but for BEDIT I can not found such system variable or other method to identify block name.

  4. My solution:
    {code}
    using System;
    using Autodesk.AutoCAD.Runtime;
    using Autodesk.AutoCAD.ApplicationServices;
    using Autodesk.AutoCAD.EditorInput;
    [assembly: CommandClass(typeof(Rivilis.BEdit))]
    namespace Rivilis
    {
    public class BEdit
    {
    [CommandMethod(“TestBEDIT”)]
    public void TestBEdit()
    {
    Document doc =
    Application.DocumentManager.MdiActiveDocument;
    Editor ed;
    if (doc != null)
    {
    ed = doc.Editor;
    if (Autodesk.AutoCAD.Internal.AcAeUtilities.IsInBlockEditor())
    {
    ed.WriteMessage(“\nWe are in block editor of block \”{0}\””,
    Autodesk.AutoCAD.Internal.AcAeUtilities.GetBlockName());
    }
    else
    {
    ed.WriteMessage(“\nWe are NOT in block editor”);
    }
    }
    }
    }
    }
    {/code}

Leave a Reply to Virupaksha AithalCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading