Lions60
2006-07-20, 04:41 PM
I am trying to move existing ellipses in dxf drawings to a new layer so at a later time they can be distinguished and converted to polylines more easily. I do have some of the code written but can't quite figure out how to get the existing elipses moved on the new layer.
Here is the code maybe someone can help:
(defun ellp2nwlyr ( / ent ename elist)
(setq ent(ssget "X" ' ((0 . "ELLIPSE"))))
(setq numb(sslength ent))
(setq count 0)
(repeat count
(setq ename (cdr ent))
(setq elist (entget ename))
(if (= (cdr (assoc 0 elist)) "ELLIPSE") ;is that something a circle?
(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
I do know this selects all ellipses in the drawing and it creates a new layer called "ellipse" but need some help getting the ellipses on this layer.
[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]
Here is the code maybe someone can help:
(defun ellp2nwlyr ( / ent ename elist)
(setq ent(ssget "X" ' ((0 . "ELLIPSE"))))
(setq numb(sslength ent))
(setq count 0)
(repeat count
(setq ename (cdr ent))
(setq elist (entget ename))
(if (= (cdr (assoc 0 elist)) "ELLIPSE") ;is that something a circle?
(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
I do know this selects all ellipses in the drawing and it creates a new layer called "ellipse" but need some help getting the ellipses on this layer.
[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]