AutoCAD 2007/2008/2009

Reply
Contributor
jbcanam
Posts: 15
Registered: ‎02-27-2007
Message 1 of 7 (3,421 Views)

convert spline to polyline

3421 Views, 6 Replies
01-06-2008 10:07 AM
how do I convert a spline to a polyline. I tried the flatten command but autocad 2007 does not recognize that command. Is there another command? Any help would be greatly appreciated.
*Terry W. Dotson
Message 2 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 10:26 AM in reply to: jbcanam
jbcanam wrote:

> how do I convert a spline to a polyline. I tried the flatten command
> but autocad 2007 does not recognize that command. Is there another
> command? Any help would be greatly appreciated.

Grab SPL2PL.VLX from the Free Stuff section of the site below.

Terry
--
Never start any job without the right tools!
AutoCAD Add-on Tools at http://www.dotsoft.com
*Expert Elite*
JDMather
Posts: 27,419
Registered: ‎04-20-2006
Message 3 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 02:16 PM in reply to: jbcanam
>autocad 2007 does not recognize that command

You have to have the Express Tools installed. Express Tools were included for free with r2007.
Please mark this response as "Accept as Solution" if it answers your question.
-----------------------------------------------------------------------------------------
Autodesk Inventor 2014 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional
Inventor Professional 2015-SP1 64-bit
http://www.autodesk.com/edcommunity
http://home.pct.edu/~jmather/content/DSG322/inventor_surface_tutorials.htm
*R.K. McSwain
Message 4 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 07:19 PM in reply to: jbcanam
jbcanam wrote:
> how do I convert a spline to a polyline.

4 options listed here:
http://rkmcswain.blogspot.com/2007/06/spline-to-polyline.html



--
R.K. McSwain
http://rkmcswain.blogspot.com
*Adesu
Message 5 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 08:02 PM in reply to: jbcanam
Hi jbcanam,
test this my code
[code]
; cstp is stand for Convert Spline To Pline
; Design by : Adesu
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Website : http://cadesu.multiply.com
; Create : 27 August 2007
; Program no.: 0646/08/2007
; Edit by :

(defun massoc (key alist / x nlist) ; Jaysen Long
(foreach x alist
(if
(eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)


(defun c:cstp (/ cmt len sp ss sse)
(if
(setq ss (car (entsel "\nSelect an object spline")))
(progn
(setq sse (entget ss))
(setq sp (massoc 10 sse))
(setq len (length sp))
(setq cmt 0)
(repeat
len
(command "_pline" (nth cmt sp)(nth (1+ cmt) sp) "")
(setq cmt (1+ cmt))
) ; repeat
(command "_erase" ss "")
) ; progn
(alert "\nInvalid selected object,try again")
) ; if
(princ)
)
[/code]

wrote in message news:5813437@discussion.autodesk.com...
how do I convert a spline to a polyline. I tried the flatten command but
autocad 2007 does not recognize that command. Is there another command? Any
help would be greatly appreciated.
*Gehenna
Message 6 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 09:01 PM in reply to: jbcanam
Adesu wrote:
> Hi jbcanam,
> test this my code
> [code]
> ; cstp is stand for Convert Spline To Pline
> ; Design by : Adesu
> ; Email : mteybid@yuasabattery.co.id
> ; Homepage : http://www.yuasa-battery.co.id
> ; Website : http://cadesu.multiply.com
> ; Create : 27 August 2007
> ; Program no.: 0646/08/2007
> ; Edit by :
>
> (defun massoc (key alist / x nlist) ; Jaysen Long
> (foreach x alist
> (if
> (eq key (car x))
> (setq nlist (cons (cdr x) nlist))
> )
> )
> (reverse nlist)
> )
>
>
> (defun c:cstp (/ cmt len sp ss sse)
> (if
> (setq ss (car (entsel "\nSelect an object spline")))
> (progn
> (setq sse (entget ss))
> (setq sp (massoc 10 sse))
> (setq len (length sp))
> (setq cmt 0)
> (repeat
> len
> (command "_pline" (nth cmt sp)(nth (1+ cmt) sp) "")
> (setq cmt (1+ cmt))
> ) ; repeat
> (command "_erase" ss "")
> ) ; progn
> (alert "\nInvalid selected object,try again")
> ) ; if
> (princ)
> )
> [/code]
>
> wrote in message news:5813437@discussion.autodesk.com...
> how do I convert a spline to a polyline. I tried the flatten command but
> autocad 2007 does not recognize that command. Is there another command? Any
> help would be greatly appreciated.
>
Using your lsp code, I get the following error message:
; error: no function definition: KEY
*Adesu
Message 7 of 7 (3,421 Views)

Re: convert spline to polyline

01-06-2008 09:48 PM in reply to: jbcanam
Hi Gehenna,
it's ok no problem, maybe you loss one string, or not completed your copy.

"Gehenna" wrote in message
news:5813592@discussion.autodesk.com...
Adesu wrote:
> Hi jbcanam,
> test this my code
> [code]
> ; cstp is stand for Convert Spline To Pline
> ; Design by : Adesu
> ; Email : mteybid@yuasabattery.co.id
> ; Homepage : http://www.yuasa-battery.co.id
> ; Website : http://cadesu.multiply.com
> ; Create : 27 August 2007
> ; Program no.: 0646/08/2007
> ; Edit by :
>
> (defun massoc (key alist / x nlist) ; Jaysen Long
> (foreach x alist
> (if
> (eq key (car x))
> (setq nlist (cons (cdr x) nlist))
> )
> )
> (reverse nlist)
> )
>
>
> (defun c:cstp (/ cmt len sp ss sse)
> (if
> (setq ss (car (entsel "\nSelect an object spline")))
> (progn
> (setq sse (entget ss))
> (setq sp (massoc 10 sse))
> (setq len (length sp))
> (setq cmt 0)
> (repeat
> len
> (command "_pline" (nth cmt sp)(nth (1+ cmt) sp) "")
> (setq cmt (1+ cmt))
> ) ; repeat
> (command "_erase" ss "")
> ) ; progn
> (alert "\nInvalid selected object,try again")
> ) ; if
> (princ)
> )
> [/code]
>
> wrote in message news:5813437@discussion.autodesk.com...
> how do I convert a spline to a polyline. I tried the flatten command but
> autocad 2007 does not recognize that command. Is there another command?
> Any
> help would be greatly appreciated.
>
Using your lsp code, I get the following error message:
; error: no function definition: KEY
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.