View Full Version : Convert Spline to Pline
f700es
27th Nov 2002, 06:57 pm
Hey guys, anybody got a lisp to convert a spline to a polyline? Need to convert one. Thanks in advance.
F7
fuccaro
28th Nov 2002, 03:50 pm
I am not shore I understand exactly your word “convert”.
If your spline is 2D it’s easy to follow the vertexes. But you will lose an the aspect. The points used for the construction of the spline are with DXF code 11. So extract them, and draw a pline using those points. Is that what you need? The program is simple, it operate on the last entity from the DWG.
(defun C:spl()
(setq pli nil)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq li (entget (entlast)))
(foreach at li
(if (= 11 (car at)) (setq pli (cons (list (cadr at) (caddr at)) pli)))
)
(reverse pli)
(command "pline")
(foreach at pli (command (list (car at) (cadr at))))
(command "")
(setvar "osmode" old)
)
fuccaro
29th Nov 2002, 08:50 am
I tried an other way, it works for a single spline. The precision is still limited –but only by your patience. Anyway, it’s better as using the lisp routine I sent before.
So, lock the layer containing your spline. On a new one, with different color, draw a pline through some points of the spline. Convert the pline in spline using PEDIT. Move the grips trying to match the two curves (AutoCAD 20x). Insert additional vertexes, if need. When finished, explode “your” spline. You got now a lot of little segments. With PEDIT you may transform one of them in pline. Editing this pline, use JOIN to add all other little segments. Ready!
f700es
2nd Dec 2002, 03:41 pm
I am not shore I understand exactly your word “convert”.
If your spline is 2D it’s easy to follow the vertexes. But you will lose an the aspect. The points used for the construction of the spline are with DXF code 11. So extract them, and draw a pline using those points. Is that what you need? The program is simple, it operate on the last entity from the DWG.
(defun C:spl()
(setq pli nil)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq li (entget (entlast)))
(foreach at li
(if (= 11 (car at)) (setq pli (cons (list (cadr at) (caddr at)) pli)))
)
(reverse pli)
(command "pline")
(foreach at pli (command (list (car at) (cadr at))))
(command "")
(setvar "osmode" old)
)
Thanks for the reply sorry it took a while to respond but had to do the Thanksgiving thing. Anyways, I have an Illustrator file that I am trying to use in AutoCAD. I have conveted the file and opened it in CAD just fine. This is a part of a sign that I want to extract and make a 3D model out of. The part I am interested in is part of a neon sign and it is some script text. When opened in autocad it becomes a spline. If it is a polyline I can just extrude a circle on this path and be done but I don't think it will work on a spline. I will try your ideas. Thanks.
F7
CADTutor
2nd Dec 2002, 03:53 pm
In theory, you can extrude a circle along a spline in AutoCAD. However, in practice it often refuses to work when the spline contains tight curves and the resulting sweep would cause the circle to be folded in on itself. You might find it easier to do the extrusion in VIZ or MAX and then bring it back into AutoCAD.
f700es
2nd Dec 2002, 05:45 pm
In theory, you can extrude a circle along a spline in AutoCAD. However, in practice it often refuses to work when the spline contains tight curves and the resulting sweep would cause the circle to be folded in on itself. You might find it easier to do the extrusion in VIZ or MAX and then bring it back into AutoCAD.
ummmm???
Good Idea!
I'll give it a try. Thanks.
F7
f700es
2nd Dec 2002, 06:33 pm
Hello all, thanks to all who replied but I found a .vlx routine that does the job. Here it is for all to use.
http://www.dotsoft.com/public/spl2pl.vlx
Here is a page of routines that might come in handy
http://www.dotsoft.com/freestuff.htm
Thanks again all.
F7
CADTutor
2nd Dec 2002, 11:37 pm
Hey, what a great resource you found. Free LISP routines galore, free symbols and more.
I'll post the details in the relevant forums.
f700es
3rd Dec 2002, 03:45 am
Hey, what a great resource you found. Free LISP routines galore, free symbols and more.
I'll post the details in the relevant forums.
When I get back to work I'll make a list of sites with such info. Where shall I post it?
F7
CADTutor
3rd Dec 2002, 11:21 am
Post it either in the LISP or Images & Models forum, whichever seems appropriate. I'll put together a new CADTutor resource page listing all the best free stuff.
Thanks.
koptev
19th Feb 2004, 01:31 pm
Hi!
To convert splines, polylines, arcs, ellipses, circles and others curve-type objects to 2d And 3d polylines - you can use convert2pl command of SmallTools Extension Library
It's free, easy to install and use
more info http://smalltools.public-k.ru
to download software http://public-k.ru/st/st.zip
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.