Type in pellipse and set value to 1 first

Registered forum members do not see this ad.
If you trim it in half or what ever and you want to connect it to another polyline is there anyway to accompolish this? Pedit doesn't work. Any help would be greatly appreciated
Thanks.

Type in pellipse and set value to 1 first
In recent versions of AutoCAD, new ellipses are created as splines. This makes more sense in terms of geometry. However, by setting the pellipse variable to 1, you force all new ellipses to be created as polylines. Unfortunately, you cannot transform existing spline ellipses using this variable.
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
AutoCAD Tutorials | How to add images to your posts | How to register successfully | Forum FAQ

Thanks a lot guys, thats exactly what I was looking for. I've asked everyone I could think of, but knew this was the place to go.. Thanks again
Originally Posted by CADTutor
Code:;| Transforms a spline ellipse into a polyline ellipse and brings it on the current layer mfuccaro@hotmail.com AUGUST 2004 ------------------------------------------------------------- |; (defun c:ell2p ; ELLipse TO Polyline ( / old cen p1 p1n p2n sc old_PELLIPSE old_OSMODE) (setq old (car (entsel "\n select ellipse to change "))) (while old (if (= (cdr (assoc 0 (entget old))) "ELLIPSE") (progn (setq cen (cdr (assoc 10 (entget old))) p1 (cdr (assoc 11 (entget old))) p1n (list (+ (car cen) (car p1)) (+ (cadr cen) (cadr p1)) (caddr cen)) p2n (list (- (car cen) (car p1)) (- (cadr cen) (cadr p1)) (caddr cen)) sc (cdr (assoc 40 (entget old))) old_PELLIPSE (getvar "PELLIPSE") old_OSMODE (getvar "OSMODE") ) (setvar "PELLIPSE" 1) (setvar "OSMODE" 0) (entdel old) (command "ELLIPSE" p1n p2n (polar cen (+ (angle cen p1n) (/ PI 2.0)) (* sc (distance cen p1n)))) (setvar "PELLIPSE" old_PELLIPSE) (setvar "OSMODE" old_OSMODE) ) (alert "This is not an ELLIPSE") ) (setq old (car (entsel "\n select ellipse or none for exit "))) ) (princ) )![]()
![]()
![]()
![]()
![]()
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
Fuccaro - what can I say? Top marks. That is an excellent little routine and more than worthy of being added to our LISP library.
That sould also be an inspiration to those wondering whether it's worth learning AutoLISP. A little bit of LISP goes a long way. Something that is impossible to do with AutoCAD out of the box is easily done with a small but perfectly formed routine.![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
AutoCAD Tutorials | How to add images to your posts | How to register successfully | Forum FAQ
Just if someone is curious how the lisp above works:
The user selects an ellipse. The data is extracted/stored and the ellipse is deleted. The PELLIPSE is set to 1 and the program draws a new ellipse (on the current layer) based on the saved data. Finaly the PELLIPSE is restored.
My turn to ask: why to transform a spline ellipse into a polyline one?
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
Just one observation. Would it not be preferable to get the layer of the old ellipse and draw in on that layer rather than the current layer? More coding, I know but it seems to make sense. The impression to the user would then be a straight transformation.
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
AutoCAD Tutorials | How to add images to your posts | How to register successfully | Forum FAQ
Code:;| Transforms a spline ellipse into a polyline ellipse mfuccaro@hotmail.com AUGUST 2004 ------------------------------------------------------------- |; ;modificated after few hours: ;the polyline ellipse is placed on the same layer (defun c:ell2p ; ELLipse TO Polyline ( / old new ;existent and new-generated ellipse cen p1 ;center, deplasament of end point of axis p1n p2n ;end points of axis sc ;scale factor for other axis length old_LAYER old_PELLIPSE old_OSMODE) ;to save settings (setq old (car (entsel "\n select ellipse to change "))) (while old (if (= (cdr (assoc 0 (entget old))) "ELLIPSE") (progn (setq cen (cdr (assoc 10 (entget old))) p1 (cdr (assoc 11 (entget old))) p1n (list (+ (car cen) (car p1)) (+ (cadr cen) (cadr p1)) (caddr cen)) p2n (list (- (car cen) (car p1)) (- (cadr cen) (cadr p1)) (caddr cen)) sc (cdr (assoc 40 (entget old))) old_LAYER (cdr (assoc 8 (entget old))) old_PELLIPSE (getvar "PELLIPSE") old_OSMODE (getvar "OSMODE") ) (setvar "PELLIPSE" 1) (setvar "OSMODE" 0) (entdel old) (command "ELLIPSE" p1n p2n (polar cen (+ (angle cen p1n) (/ PI 2.0)) (* sc (distance cen p1n)))) (setq new (entget (entlast)) new (subst (cons 8 old_LAYER) (assoc 8 new) new)) (entmod new) ;changing the layer (setvar "PELLIPSE" old_PELLIPSE) ;restore old (setvar "OSMODE" old_OSMODE) ;settings ) (alert "This is not an ELLIPSE") ) (setq old (car (entsel "\n select ellipse or none for exit "))) ) (princ) )
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
Excellent![]()
![]()
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
AutoCAD Tutorials | How to add images to your posts | How to register successfully | Forum FAQ
Bookmarks