Get Custom Commands
See also Custom Commands & Autoloader.
| Function Syntax | (LM:getcustomcommands <lsp>) |
| Current Version | 1.0 |
| Download | GetCustomCommandsV1-0.lsp |
| View HTML Version | GetCustomCommandsV1-0.html |
| Donate |
| Arguments | ||
|---|---|---|
| Symbol | Type | Description |
| lsp | String | AutoLISP file filename |
| Returns | ||
| Type | Description | |
| List | List of all custom commands defined by the supplied AutoLISP file | |
Program Description
This function returns a list of all custom commands (that is, AutoLISP functions with a c: prefix) defined by a given AutoLISP file, without loading the file in the current session.
The function reads the entire content of the supplied AutoLISP file using the File System Object, and then determines the custom commands defined therein by matching the content against an appropriate Regular Expression.
This enables the custom commands to be determined without loading the file in the active session and inspecting differences in the list of defined symbols returned by the (atoms-family) function.
This function is the basis for my Autoloader and Custom Commands programs.
Example Function Call
(defun c:test ( / lsp ) (if (setq lsp (getfiled "Select AutoLISP File" "" "lsp" 16)) (foreach cmd (LM:getcustomcommands lsp) (print cmd) ) ) (princ) ) (vl-load-com) (princ)
