Trying to get this code to automate the selection of all ellipses instead of user secting ellipses. The program isn't selecting ellipses it says ther eis an error in the selection set.
Here's the code:
(defun e2p ()
(if (setq lstSelection (ssget "X" '((0 . "ELLIPSE"))))
(el2p (car lstSelection))
)
(princ)
)
(defun El2p (objEllipse)
(if (= (type objEllipse) 'ENAME)
(setq objEllipse (vlax-ename->vla-object objEllipse)))
(setq sngIncrement (/ (vlax-curve-getdistatparam objEllipse (vlax-curve-getendparam objEllipse)) 100.0)
sngPosition 0.0
)
(command "ortho" "off" "pline")
(repeat 101
(command (vlax-curve-getpointatdist objEllipse sngPosition))
(setq sngPosition (+ sngPosition sngIncrement))
)
(command "")
(vla-delete objEllipse)
(princ)
)