@Anonymous wrote:
.... I'm still a bit fuzzy on what (blkname / pt ang) in the lisp dose ....
To expand on what stevor said about blkname:
Anything before the slash [/] in the parentheses following a function name is an argument, as distinguished from the things that come after the /, which are variables. Think of it as a kind of variant on a variable, a 'placeholder' for a value that is going to be fed in when the function is used.
When you do:
(BlockOnEdge "EES")
the "EES" is the argument, and wherever the blkname placeholder occurs in the function definition, that argument will be fed in. So when it gets to:
(command
"_.insert" blkname "_scale" 1 ....
it will be supplied with the "EES" [or another Block name in the other command definitions] in place of the blkname argument/placeholder. That's how one function definition can be used in any number of different command definitions -- each command calls that same function but supplies its own argument value.
Note the difference between:
(defun BlockOnEdge
without the C: before its function name, and:
(defun C:EE5
with the C: before its command name. Command definitions with the C: can't have arguments before the slash; function definitions without it can, though they don't always need to. In either type, if there are no arguments or localized variables, they still need their name to be followed by either [as I usually do it] empty parentheses or [as you will sometimes see it done] nil in their place.
When you use a function with one or more arguments in its definition, you must supply a value for each argument, within the parentheses calling the function, and if there's more than one, in the order in which their placeholders are listed in the function definition. If you were to try:
(BlockOnEdge)
without supplying a value for the blkname argument, it would complain to you that you didn't supply enough information:
; error: too few arguments
Also, you type in a command name "plain" to use it, e.g. EES, but a function must be called inside parentheses, just like the difference between using an AutoCAD command and an AutoLisp function at the Command: prompt.
To use a custom-defined command name within another AutoLisp routine, you likewise call it in parentheses and with the C: prefix, e.g. (C:EES). You can't use it in a (command) function, which only recognized AutoCAD's own command names.
Kent Cooper, AIA