@Tornac wrote:
After kents post i wanted to see how = would work as well.
(if (= (OR (cdr (assoc 0 ll)) "POLYLINE" "LWPOLYLINE" "LINE"))
....
Actually, that's not a valid construction for the purpose. The result of the (or) function is the only thing supplied to the (=) function, and if an (=) function is supplied only one argument, it returns T, even if that one argument is nil. But it won't be anyway -- since the (or) function includes some things that are not nil [the text strings, no matter what they actually say, even if they have nothing to do with entity type names], it will always return T, so the (=) function will also always return T, no matter what the entity type is. If the entity is an Arc, that's equivalent to the (if) function checking whether or not:
(= (or "ARC" "POLYLINE" "LWPOLYLINE" "LINE"))
which returns T, as it also would if the entity were of any other type at all.
I think the only way to do this with a combination of (=) and (or) would be as in Post 1, though you could shorten that a little by putting (cdr (assoc 0 ll)) into a variable, instead of spelling it out separately within each (=) function.
Kent Cooper, AIA