Here are some thougts on this....
Originally Posted by
Lions60
Here is the code maybe someone can help:
Code:
(defun ellp2nwlyr ( / ent ename elist)
(setq ent(ssget "X" ' ((0 . "ELLIPSE"))))
(setq numb(sslength ent))
(setq count 0)
(repeat count ;;;;no need to repeat, especially checking/setting/creating the layer, just use the ss in a command call
(setq ename (cdr ent))
(setq elist (entget ename))
(if (= (cdr (assoc 0 elist)) "ELLIPSE") ;is that something a circle? why this? you already filtered for only ellipses....
(progn
(if (tblsearch "layer" "ellipse")
(command "-layer" "s" "ellipse")
(command "-layer" "m" "ellipse" "c" "red" "ellipse" "")
);;end of if
);; end of progn
);; end of if
);; end of repeat
);; end of program
Here's how I'd do it:
Code:
(defun ellp2nwlyr ( / ent ename elist)
(if (setq ent (ssget "X" ' ((0 . "ELLIPSE"))))
(progn
(if (tblsearch "layer" "ellipse")
(command "-layer" "s" "ellipse")
(command "-layer" "m" "ellipse" "c" "red" "ellipse" "")
);;end of if
(command "_.chprop" ent "" "la" "ellipse" "")
)
)
);; end of program
HTH,
Jeff