(defun c:**r** nil
(if averigua
(progn
(vlr-remove **a**)
(setq **a** nil averigua nil)
(princ "Open-file Command-line DEACTIVATED");"SensiCMD DESACTIVADO")
)
(progn
(setq **a** (vlr-command-reactor "***" '((:vlr-unknowncommand . averigua))))
(defun averigua (a b / c)
(if (setq c (findfile (vl-string-subst "." "@" (car b))))
;;; (decodifica c)
(LM:open c)
)
)
(princ "Open-file Command-line ACTIVATED");"SensiCMD ACTIVADO")
)
)
(princ)
)
Here you go.
Copy this code into the acad*.lsp file where you save your custom lisps.
Once loaded, you can enable or disable the included code by typing the **r** command.
I assume you've downloaded Lee Mac's code (LM:open).
It's perfect for what you need, so I've included a call to "LM:open," but you'll have to add the code for this function yourself.
As for the **r** command, when the included code is enabled, anything you type on the command line that matches the name of a file found in any of AutoCAD's "SupportPaths," "LM:open" will open it with the default Windows application. This will happen without any command being executed
To disable the code, just run **r** again.
PS: When typing any file name, you must replace the . with @
Example: to "acad.lsp" type "acad@lsp"
I hope it's useful