+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 37
  1. #1
    Full Member
    Using
    not specified
    Join Date
    Oct 2003
    Posts
    41

    Default Anyway to Change an Ellipse into a Polyline?

    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.

  2. #2
    Full Member
    Using
    not specified
    Join Date
    Mar 2003
    Location
    Lousiania
    Posts
    33

    Default

    Type in pellipse and set value to 1 first

  3. #3
    Administrator CADTutor's Avatar
    Computer Details
    CADTutor's Computer Details
    Operating System:
    Windows Vista Home Premium SP2 32bit
    Motherboard:
    Asus P5K WS
    CPU:
    Intel Core2Duo E6850 @ 3.0 GHz
    RAM:
    4GB PC2-8500 C5 Corsair Dominator
    Graphics:
    NVIDIA Quadro FX 1700 512 MB
    Stotage:
    Samsung Spinpoint T166 320 GB
    Monitor:
    BenQ FP241W 24" Wide
    Using
    AutoCAD 2010
    Join Date
    Aug 2002
    Location
    Hampshire, UK
    Posts
    3,256

    Default

    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

  4. #4
    Full Member
    Using
    not specified
    Join Date
    Oct 2003
    Posts
    41

    Default

    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

  5. #5
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,159

    Default

    Quote Originally Posted by CADTutor
    Unfortunately, you cannot transform existing spline ellipses using this variable.
    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.

  6. #6
    Administrator CADTutor's Avatar
    Computer Details
    CADTutor's Computer Details
    Operating System:
    Windows Vista Home Premium SP2 32bit
    Motherboard:
    Asus P5K WS
    CPU:
    Intel Core2Duo E6850 @ 3.0 GHz
    RAM:
    4GB PC2-8500 C5 Corsair Dominator
    Graphics:
    NVIDIA Quadro FX 1700 512 MB
    Stotage:
    Samsung Spinpoint T166 320 GB
    Monitor:
    BenQ FP241W 24" Wide
    Using
    AutoCAD 2010
    Join Date
    Aug 2002
    Location
    Hampshire, UK
    Posts
    3,256

    Default

    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

  7. #7
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,159

    Default

    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.

  8. #8
    Administrator CADTutor's Avatar
    Computer Details
    CADTutor's Computer Details
    Operating System:
    Windows Vista Home Premium SP2 32bit
    Motherboard:
    Asus P5K WS
    CPU:
    Intel Core2Duo E6850 @ 3.0 GHz
    RAM:
    4GB PC2-8500 C5 Corsair Dominator
    Graphics:
    NVIDIA Quadro FX 1700 512 MB
    Stotage:
    Samsung Spinpoint T166 320 GB
    Monitor:
    BenQ FP241W 24" Wide
    Using
    AutoCAD 2010
    Join Date
    Aug 2002
    Location
    Hampshire, UK
    Posts
    3,256

    Default

    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

  9. #9
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,159

    Default

    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.

  10. #10
    Administrator CADTutor's Avatar
    Computer Details
    CADTutor's Computer Details
    Operating System:
    Windows Vista Home Premium SP2 32bit
    Motherboard:
    Asus P5K WS
    CPU:
    Intel Core2Duo E6850 @ 3.0 GHz
    RAM:
    4GB PC2-8500 C5 Corsair Dominator
    Graphics:
    NVIDIA Quadro FX 1700 512 MB
    Stotage:
    Samsung Spinpoint T166 320 GB
    Monitor:
    BenQ FP241W 24" Wide
    Using
    AutoCAD 2010
    Join Date
    Aug 2002
    Location
    Hampshire, UK
    Posts
    3,256

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts