@Jrooker06 wrote:
It was my off that wanted to make it into a lisp and use this as the standard command. So i used this for the Lisp
;;Isolate Selected Layer
(defun C:LIO () (C:LAYISO) (princ))
.... i would like to understand what everything does. Of course i understand "(defun C:LIO" and "(C:LAYISO)" but what does the rest of the code mean exactly?
I guess if you have those commands loaded by something like acaddoc.lsp from a shared server location, that could be a better approach than using command aliases, since the former can be applied to all computers on the network, whereas the latter would require setting the aliases on every computer separately. [You could do it with a shared .PGP file for aliases, but that would require removing those from all individual computers, and people wouldn't be able to customize aliases for themselves independently.]
The first pair of parentheses after the command name is to hold any arguments and/or localized variables that are required by or used within the function or command. In this case there aren't any, but the parentheses are still required, even if there's nothing in them.
The (princ) at the end is for what is referred to as "exiting quietly." You could probably do without it in this case. Mostly it's used so that you don't see the returned value from the last function within the routine. For example, routines often end with resetting of some System Variables that were changed inside the routine. If, say, it turned off command echoing by first saving the value of the CMDECHO System Variable and then setting it to 0, it would typically reset it to 1 [presumably the initial value that it saved earlier] at the end. If that's the last thing that happens in the routine, then that 1 will be returned at the Command: prompt line when it's done. Or if it ends with a completed (command) function that did something, that always returns nil, and the nil will show up at the Command: prompt line. The (princ) with no arguments [or (print) or (prin1)] returns nothing at all, so it just goes back to the Command: prompt without showing something that may confuse Users who don't know how these things work. It's only for the "look" of the command in operation at the end, but otherwise serves no operational function.
The right parenthesis at the very end is the mate of the left parenthesis at the very beginning -- they always need to come in pairs.
Kent Cooper, AIA