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.

Leave a Reply