Hello, roy_043,
Is it perhaps possible to return to the old, AutoCAD 2004, behaviour?
It's new to me, that it was not so in earlier releases. I remember the ObjectDCL times. There was such a property too. And it's even necessary. In a modal form all the events will be called in a document locked state. To be sure to get access to the drawing, you have to close the form and to finish the close event.
In a modeless form or a palette it is similar: when using KeepFocus, the event will be called in a "locked" mode. To get access to the drawing you have to leave the event at first. That can only be solved using a command (AllowCommand). OpenDCL is using such a thing like SendString so the event will be started as a command.
What can you do? I have a palette, too with a library of signs the user can choose and draw. He can choose a sign by double clicking in a list, in a tree or by pressing a button - as the user prefer. Since I don't like the output of (c:signothek_sc_palette_dwgpreview1_OnDblClicked) or (c:signothek_sc_palette_lsitview_OnDblClicked 1 1), too, I created a command sc_signothek_draw, which is called from the events. In the end the controls are using EventInvoke KeepFocus and within the event functions I use an vla-sendcommand that invokes the start of the command after the event function has been finished. In this way you have to make sure, that the command can be used. Just define a global variable, and only it is set and contains valid data, let your function do the desiered job.
The other thing you can do is to overwrite the event function name and set the EventInvoke to AllowCommand. Then the user can see your command which is more readable.
I used the fact as an advantage: Once the user has selected a sign, he can repeat the command just by hitting Enter to draw the same signe once again. The same way as AutoCAD works.
By the way: You can break the current command by typing ^C^C in front of the command name.
In the end it is this no matter of OpenDCL: it is the same way I have to call events asynchronously from a palette built in C#, for instance.
Regards, Fred