0

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.

FLCL
  • 2,445
  • 2
  • 24
  • 45
  • What exactly are you trying to edit in the block? As far as I know there's no way to skip this dialog, however the block editor itself is really designed for user interaction. Would it be possible to get around this by editing the block programmatically? – Parrish Husband Jan 27 '14 at 13:56
  • @Locke,I need to organize special editor state, when only the entities of my temporally created block will be seen. – FLCL Jan 27 '14 at 14:01
  • I'll look into BEDIT some more, maybe there's a way to temporarily suspend functionality of the dialog or something. A sloppy way to implement what you want would be to copy the block out in the middle of empty space and zoom to it. Once editing is done, it blows away the copy and makes the changes you want. – Parrish Husband Jan 27 '14 at 15:02
  • Ok, so this might help you. If you select a block beforehand and then invoke BEDIT, the block you selected will be the highlighted block in the dialog box that pops up. All you need to proceed is an enter key press, which you could virtualize. You might even be able to make it appear that the dialog doesn't pop up at all by disabling screen updating immediately before invoking BEDIT, and then flipping it back on and refreshing after sending an enter key. Still a bit sloppy, but the concept appears sound. – Parrish Husband Jan 27 '14 at 15:09

1 Answers1

1

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); 
Parrish Husband
  • 3,148
  • 18
  • 40
  • Oh, thank you very much! My current solution was to find the window and click OK button, lol. You solution works perfectly(if remove spaces and move \n to the end: '(Command\"._BEDIT\"\"" + blockName + "\")\n' ). – FLCL Jan 27 '14 at 18:53