Search code examples
c#autocadautocad-pluginobjectarx

Hide block selection dialog on bedit command


I need to open block editor for block by its name, so I execute command in this way:

document.SendStringToExecute("_BEDIT "+blockName+"\n", true, false, false); 

After running this line of code "selection of block" dialog appears, but I need the block to be selected automatically. So is there any way to run into block editor state without any dialog? I have not found any method to run block editor without using command line and there is no system variable found to make dialog disappear.


Solution

  • Solved it. Just took some playing around. Enclose the operation in a lisp command, passing the block name after the BEDIT command and you're golden.

    (Command "BEDIT" "ExampleBlock")
    

    So in the context of SendStringToExecute it would be something like this:

    document.SendStringToExecute("(Command \"._BEDIT\" \"" + blockName + "\"\n)", true, false, false);