Good for you
same as
- (setq lst nil)(setq p1 (getpoint "\n specify First Point :"))
But with the and condition we cannot code it that way, as it evaluates to nil at the first expression and will exit the loop.
There's nothing magical about that john, the way the original code was written (kudos to Tharwat) at every loop it checks the lst variable for the selected entities layer name.
To explain to you the effect without resetting the lst variable
Lets say selected entities layer are "B1" and "C4"
(if
(not (member layer lst))
(setq lst (cons layer lst)))
same goes for C4 layer name.
("B1" "C4") as current value for lst variable
Now for next loop, selected objects layers are "D5" and "E1"
Layers "D5" and "E1" will be included on the lst.
Current value of lst variable would be ("B1" "C4" "D5" "E1") but remember you did not select any objects on "B1" or "C4" layer. and you will get "B1" "C4" "D5" "E1" as string value for you mleader. hence the reset at the start of the loop.
But then again, we can always reset the lst variable here to avoid confusion on your part.
- (setq str lst [b][i][color="blue"]lst nil[/color][/i][/b])
as for this one
Yes, it can be done Go ahead and show us the desired result. |