Well, posted a routine not long ago that lets you convert Splines to Polylines. I just found a better routine than the one I posted made by Lee-Mac that lets you convert many types of objects to polylines. It even lets you select a polyline and add more segments to it (as seen with the rectangle in the animated pic)

Here’s how:

  • SEGS <enter> to start
  • Select objects – Line, Arc, Circle, Ellipse, Rectangle, Polyline, Spline…
  • <enter> when finished selecting objects
  • Specify # of segments (the more segments the smoother curved objects will look)


;;---------------------=={ Segment Curve }==------------------;;

;; ;;

;; Divides selected objects into an LWPolyline with a ;;

;; specified number of segments of equal length. ;;


;; Author: Lee Mac, Copyright © 2011 - ;;


(defun c:Segs ( / *error* _StartUndo _EndUndo acdoc ss j ) (vl-load-com)

(defun *error* ( msg ) (and acdoc (_EndUndo acdoc))

(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")

(princ (strcat "\n** Error: " msg " **")))



(defun _StartUndo ( doc ) (_EndUndo doc)

(vla-StartUndoMark doc)


(defun _EndUndo ( doc )

(if (= 8 (logand 8 (getvar 'UNDOCTL)))

(vla-EndUndoMark doc)



(setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)) *segs (cond ( *segs ) ( 10 )))


(and (setq ss (ssget "_:L" '((0 . "ARC,CIRCLE,LWPOLYLINE,SPLINE,LINE,ELLIPSE"))))

(progn (initget 6)

(setq *segs (cond ( (getint (strcat "\nSpecify Number of Segments <" (itoa *segs) "> : ")) ) ( *segs )))



(progn (_StartUndo acdoc)

(repeat (setq j (sslength ss))


(lambda ( e / k l i p )

(setq k (/ (vlax-curve-getDistatParam e (vlax-curve-getEndParam e)) (float *segs))

l (entget e)

i -1


(repeat (1+ *segs)

(setq p (cons (cons 10 (trans (vlax-curve-getPointatDist e (* (setq i (1+ i)) k)) 0 e)) p))






(cons 0 "LWPOLYLINE")

(cons 100 "AcDbEntity")

(cons 100 "AcDbPolyline")

(cons 90 (length p))

(cons 38 (last (car p)))

(cons 70 (if (vlax-curve-isClosed e) 1 0))


(apply 'append

(mapcar '(lambda ( a ) (if (assoc a l) (list (assoc a l)))) '(6 8 39 48 62 210))





(entdel e)



(ssname ss (setq j (1- j)))



(_EndUndo acdoc)





About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to AutoLISP: Curves To POLYLINE

  1. Pingback: AutoLISP: Make and Save Custom Hatch Pattern | AutoCAD Tips

  2. asdf says:

    Thank! Works wonders!

  3. jino says:

    thakz… work easily…..

  4. saquibmd says:

    i am trying segs lisp and i process also done but when i use savehatch commond for creating hatch “Line with invalid angle 235.159428º omitted” error occured with many lines like that.
    and process is complete with error.
    then, when i apply hatch “Missing parameter on line 2804.” error is occured.
    so plz help me how can i draw hatch. (I have to darw hatch for tiles)

  5. Georgi says:

    Hilarious, thanks a LOT !!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s