PDA

View Full Version : Converting splines



Dan5
22nd Feb 2008, 11:29 am
How do I convert splines to polylines / arcs?

I have never found a simple comand to do this.

Thanks :)

Alan Cullen
22nd Feb 2008, 11:42 am
Dunno, if you PEDIT and DECURVE you end up with a segmented polyline. So I guess I'm no help. Sorry.

GE13579
22nd Feb 2008, 11:43 am
This has been covered quite a bit in the past... check some of the associated threads below... vvv :wink:

Dan5
22nd Feb 2008, 11:47 am
Ahh, that looks good thanks. I did search but only two unrelated posts came up.

Much apprechiated :D

Alan Cullen
22nd Feb 2008, 12:18 pm
Gary, 14 posts to go. :P

I'm watching you. o:)

GE13579
22nd Feb 2008, 12:18 pm
Lol I was hoping I could fly under the radar- but alas!!!! :lol:

Alan Cullen
22nd Feb 2008, 12:23 pm
good going, mate. That last post brings you down to 12. Tonight? :lol: :lol: :twisted:

Dan5
22nd Feb 2008, 12:27 pm
Um, is a .vlx file any good for this?

Have found spl2pl.vlx but can't find a spl2pl.lsp anywhere...

GE13579
22nd Feb 2008, 12:35 pm
This was written down by SCJ in one of the related threads- maybe Alan could check it as my knowledge of Lisps goes about as far as saving them and using them :lol:


;--------------------------------------------SPL2POL.LSP--------------------------
;----------------------Change of an SPLINE to a POLYLINE--------------
;--Given is an SPLINE. It will be changed into an approximated POLYLINE.
;--spli : spline
;--aufl : number of vertices for the approximation
;--pt : vertex
;-------------------------------------------------------------------------------------
;
;-------------------------------------------------------------------------------------
;(defun C:spl2pol (/ spli aufl elem p0 pkt ll)
(defun C:spl2pol ()
;-------------------------------------------------------------------------------------
(setq pktliste nil)
(print "Please select a spline :")
(setq spli (ssget))
(setq aufl (getint "\nnumber of vertices:<300> : "))
(if (= nil aufl) (setq aufl 300))
(setq elem (entget (ssname spli 0)))
(setq p0 (cdr (assoc 10 (entget (ssname spli 0)))))

(if (= (cdr (assoc 0 elem)) "SPLINE")
(progn
(command "_divide" spli aufl)
(setq pktsatz (ssget "_p"))
(setq ll (sslength pktsatz))
;(PRINT ll)
(command "_3dpoly")
(command p0)
(setq i -1)
(setq ll (- ll 1))
(while (< i ll)
(progn
(setq i (+ 1 i))
(setq pkt (cdr (assoc 10 (entget (ssname pktsatz i)))))
(command pkt)
)
)
(command "")

)
(princ (strcat (cdr (assoc 0 elem)) " is no SPLINE----->EXIT"))
)
(command "_ERASE" pktsatz nil)
(princ)
)

;
;


PS I think it might be next week judging by my pace at climbing the ladder Alan... :oops: :lol:

chulse
22nd Feb 2008, 12:37 pm
Um, is a .vlx file any good for this?

Have found spl2pl.vlx but can't find a spl2pl.lsp anywhere...

It should work the same as a lisp. I think that is the one I have and it works well.

Dan5
22nd Feb 2008, 12:37 pm
Thanks again, much appreciated :)

Alan Cullen
22nd Feb 2008, 12:48 pm
Looks okay to me, haven't tested it, so don't rely on my opinion of it. :P

GE13579
22nd Feb 2008, 01:08 pm
Thanks Alan :thumbsup: