arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 31 agosto 2015 : 09:01:12
|
MTEditReactorV1-0.lsp
Program Description
This short code snippet was born from a question I received from a visitor of my site, asking whether it was possible to automatically select all text content when double-clicking on an MText object, as per the result of double-clicking on single-line text object.
As demonstrated by the GIF animation below, this behaviour is already part of the standard AutoCAD DDEDIT command when a single-line text object is edited or selected via a double-click, and so this utility provides a consistent result when double-clicking an MText object.
The utility is driven by a Visual LISP Command Reactor which monitors for the use of the MTEDIT command (the command invoked as standard when a user double-clicks on an MText object). When this command is invoked with an MText object already selected, the utility will send the keystrokes Ctrl+Home followed by Ctrl+Shift+End to the AutoCAD window, causing the text content to be automatically selected. When developing the code, I initially attempted to issue the Ctrl+A keystroke, however, this was unsuccessful in my tests.
Similar to my Layer Director application, the program is designed to enable the reactor automatically when the program is loaded, and the user may subsequently enable or disable the utility manually using the mteditreactoron and mteditreactoroff commands respectively.
|
|