Execute Commands from a Modeless dialog

By Augusto Goncalves

As a modeless dialog in AutoCAD application run on session, we cannot execute commands, so below is a list of alternatives:

1. Use the function AcApDocManager::sendStringToExecute() (ensure one escape (ASCII 27) characters down first before the real string, this will cancel any previous running commands, if any).

2. Simulate menu selection by sending WM_COMMAND rather than WM_CHAR messages. Once the command is active you can then, of course, send WM_CHAR messages for the parameters. This would then only call commands that exist in the menu structure (though they could hidden/deeply nested).

3. Use the function int acedPostCommand(const ACHAR*) to send characters command-prompt.

4. Use the function int ads_queueexpr(const ACHAR *) to again send characters to the command prompt.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

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

Continue reading