Author Topic: Ellipse/Spline question  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Ellipse/Spline question
« on: July 13, 2006, 09:55:34 AM »

Is there a way to explode an ellipse or spline?
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Ellipse/Spline question
« Reply #1 on: July 13, 2006, 09:56:50 AM »
i dont think so
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Ellipse/Spline question
« Reply #2 on: July 13, 2006, 10:00:56 AM »

That's what I thought. I tried everything and still no go.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Ellipse/Spline question
« Reply #3 on: July 13, 2006, 10:09:36 AM »
What are you looking for after you explode the object? That is what new object type. Arcs? Lines?


http://www.theswamp.org/index.php?topic=1804.msg23108#msg23108
« Last Edit: July 13, 2006, 10:13:39 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Ellipse/Spline question
« Reply #4 on: July 13, 2006, 10:13:11 AM »

Well the End result I want it to be a lwpolyline. I tried to Bpoly inside an ellipse or spline and the result is it creates a Region.. I then try to Bpoly inside an Region and the result is another Region. If I explode a Region the result goes back to the original item i.e. ellipse/spline.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Ellipse/Spline question
« Reply #5 on: July 13, 2006, 10:14:52 AM »
See the link i just added to my previous post.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Ellipse/Spline question
« Reply #6 on: July 13, 2006, 10:19:29 AM »

Thanks I will check it out.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CarlB

  • Guest
Re: Ellipse/Spline question
« Reply #7 on: July 13, 2006, 01:47:59 PM »
To create a polyline rather than a region with the "boundary" command, change HPBOUND system variable to 1.

CADaver

  • Guest
Re: Ellipse/Spline question
« Reply #8 on: July 13, 2006, 03:47:43 PM »
To create a polyline rather than a region with the "boundary" command, change HPBOUND system variable to 1.
In R2002 that'll still force a region.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Ellipse/Spline question
« Reply #9 on: July 13, 2006, 04:17:30 PM »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

LE

  • Guest
Re: Ellipse/Spline question
« Reply #10 on: July 13, 2006, 04:43:12 PM »
or..... (for the ellipses) recreate them and set PELLIPSE = 1

lispman21

  • Guest
Re: Ellipse/Spline question
« Reply #11 on: July 25, 2006, 02:51:36 PM »
here is a little lisp routine to convert ellipses to lwpolylines, this also does elliptical arcs but it converts them to there full elliptical state and cannot figure out how to trim it back to the arc it was.  but this does do ellipses.



The Code:
 
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                         ;;
;;    AutoLisp Program                                                     ;;
;;    PROGRAM: existing ellipses to Plines.lsp                             ;;
;;    DATE: 4-19-06                                                        ;;
;;    File Location: C:\Program Files\Trane Company\Data Maintenance\SM    ;;
;;    BY: Jeremy Preston                                                   ;;
;;                                                                         ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defun e2p( /
old new   ;existent and new polyline
sav    ;store system variables
cen    ;center of ellipse
dep    ;axis end point deplacement (relative to cen)
p1 p2 ;first axis enpoints
p3 ;sec. axis endpoint
 ellObjs   ; added
 numObjs   ; added   
 count ; added   
   )

(setq ellObjs (ssget "x" '((0 . "ELLIPSE"))))
(if ellObjs
  (progn
  (setq numOjbs (sslength ellObjs)
 count 0
 )
  (while (> numOjbs count)
(setq old (cdr (assoc -1 (entget (ssname ellObjs count)))))


   (setq sav (mapcar 'getvar '("PELLIPSE" "OSMODE" "UCSICON"))
cen (cdr (assoc 10 (entget old)))
dep (cdr (assoc 11 (entget old))))
   (mapcar 'setvar '("PELLIPSE" "OSMODE" "UCSICON") '(1 0 0))
   (command "UCS" "e" old)
   (setq p1 (trans (list (+ (car cen) (car dep))
   (+ (cadr cen) (cadr dep))
   (+ (caddr cen) (caddr dep)))
0 1)
p2 (trans (list (- (car cen) (car dep))
   (- (cadr cen) (cadr dep))
   (- (caddr cen) (caddr dep)))
0 1)
p3 (trans (polar cen
(+ (/ PI 2.0) (angle p1 p2))
(* 0.5 (cdr (assoc 40 (entget old))) (distance p1 p2)))
0 1)
)
   (command "ellipse" p1 p2 p3)
   (command "_.chprop" old "" "la" "0" "")   
   (setq new (entget (entlast))
new (subst (cons 8 (cdr (assoc 8 (entget old)))) (assoc 8 new) new))
   (entmod new)
   (entdel old)
   (command "ucs" "p")
   (mapcar 'setvar '("PELLIPSE" "OSMODE" "UCSICON") sav)

(setq count (1+ count))
); while
  ); progn
  ); if
(princ)
   );; end of program

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun 2d2lw()
  (prompt "\nChanging LW to 2D\n ")
  (setq count 0)
   (if(setq sset (ssget "X" ' ((0 . "POLYLINE"))))
     (command "convertpoly" "L" sset"")
   );; end of if

 );; end of program

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defun 2d()

(e2p) 
(2d2lw)
);; end of program

(alert "Program automatically starts when you press ok")
(2d)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Ellipse/Spline question
« Reply #12 on: July 25, 2006, 03:19:59 PM »
Thanks for sharing your code lispman21 (Jeremy?), and welcome to the swamp.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Ellipse/Spline question
« Reply #13 on: July 25, 2006, 04:06:38 PM »
Humm, another?
Look like a revision of this code, no?
http://cadtutor.net/forum/viewtopic.php?p=8739#8739
« Last Edit: July 25, 2006, 04:12:28 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.