You're welcome
The lambda function in my first example, and the IterateSelSet in my second are identical in the way they function. They are both doing the same thing, both taking a single numerical argument. But the lambda function can only be used in this once instance, as it is anonymous and hence cannot be 'called' later on.
Both these functions take one argument 'i', this is used to iterate through the SelectionSet using the ssname function, this is equivalent to doing this:
- (setq i -1)(while (setq e (ssname ss (setq i (1+ i)))) ...)
Except, as we are only using 'i' this once, there is no point perhaps to define it as a variable, but rather just pass it as an argument to an anonymous function, - that way, everything is kept as one block if you like. Of course, there are many ways to approach this, and I'm not proclaiming that any way is the right way, just my preference. |