Hello all, Below is a snippet of some code I am working on, however, I am having trouble with the if/then when determining what layer the object is on. I threw in some commented psuedo code so you can see where I am having problems. Basically, if the object is on layer 1, then solid fill it, if on layer 2 then another hatch, etc. etc. Many thanks. (setq ss (ssget '((0 . "CIRCLE,POLYLINE,LWPOLYLINE,TEXT,MTEXT"))) i -1 ss1 (ssadd) ) (repeat (sslength ss) ;;if the layer is 1 then (command "_.hatch" "s" (ssname ss (setq i (1+ i))) "") ;SOLID ;;end if ;;if the layer is 2 then (command "_.hatch" hat_pat hat_scale hat_angle (ssname ss (setq i (1+ i))) "" ) ;;end if (ssadd (entlast) ss1) ) (command "_.draworder" ss1 "" "b")