Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
colin1234
Posts: 19
Registered: ‎09-13-2004
Message 1 of 9 (68 Views)

Spline to pline

68 Views, 8 Replies
09-24-2004 03:09 AM
is there a routine which one can use to convert a spline to a polyline?

thanks

Colin
*Doug Broad
Message 2 of 9 (68 Views)

Re: Spline to pline

09-24-2004 05:02 AM in reply to: colin1234
Colin, What do you hope to accomplish? Would you want the translated version to be a spline curve fit pline or one that uses straight or arc curved segments to most closely approximate the spline curve? Regards, Doug "colin1234" wrote in message news:7967882.1096020604543.JavaMail.jive@jiveforum2.autodesk.com... > is there a routine which one can use to convert a spline to a polyline? > > thanks > > Colin
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 3 of 9 (68 Views)

Re: Spline to pline

09-24-2004 05:49 AM in reply to: colin1234
If you just want a facsimile of your spline:

Use the measure command at desired distance and use the points to draw you pline. This can be done programically.

Untested:

(defun dup_spline (/ ent d1)
(setq ent (car (entsel "\nselect spline")))
(setq d1 (getdist "\nDistance between points."))
(command ".measure" ent d1)
(setq ptlist (ssget "P"))

(setq cnt 0)
(command ".pline")
(repeat (sslength ptlist)
(setq pt (cdr (assoc 10 (entget (ssname ptlist cnt))))
cnt (1+ cnt))
(command pt)
)
(command "cl")
;(entdel ent) ;remove semi colin to del spline
)

Bill
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 4 of 9 (68 Views)

Re: Spline to pline

09-24-2004 05:54 AM in reply to: colin1234
Oh yeah,

If you want the points removed add (command ".erase" ptlist "")

(defun dup_spline (/ ent d1)
(setq ent (car (entsel "\nselect spline")))
(setq d1 (getdist "\nDistance between points."))
(command ".measure" ent d1)
(setq ptlist (ssget "P"))

(setq cnt 0)
(command ".pline")
(repeat (sslength ptlist)
(setq pt (cdr (assoc 10 (entget (ssname ptlist cnt))))
cnt (1+ cnt))
(command pt)
)
(command "cl")
;(entdel ent) ;remove semi colin to del spline
(command ".erase" ptlist "")
)

Bill
Contributor
colin1234
Posts: 19
Registered: ‎09-13-2004
Message 5 of 9 (68 Views)

Re: Spline to pline

09-24-2004 06:31 AM in reply to: colin1234
I want the polyline to match the spline line such that after conversion i can change the width of the polyline easily to suit the purposes of the drawing.
*Jim Claypool
Message 6 of 9 (68 Views)

Re: Spline to pline

09-24-2004 06:39 AM in reply to: colin1234
The FLATTEN command in 2004 and 2005 will convert it. "colin1234" wrote in message news:7967882.1096020604543.JavaMail.jive@jiveforum2.autodesk.com... > is there a routine which one can use to convert a spline to a polyline? > > thanks > > Colin
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 7 of 9 (68 Views)

Re: Spline to pline

09-24-2004 07:31 AM in reply to: colin1234
Thanks Jim.

I didn't know that.



Bill
*Nava Ran
Message 8 of 9 (68 Views)

Re: Spline to pline

09-24-2004 07:44 AM in reply to: colin1234
http://www.dotsoft.com/freestuff.htm download spl2pl.vlx spl2pl converts a selection set of splines to polylines inside the drawing. "colin1234" wrote in message news:7967882.1096020604543.JavaMail.jive@jiveforum2.autodesk.com... > is there a routine which one can use to convert a spline to a polyline? > > thanks > > Colin
*Jürg Menzi
Message 9 of 9 (68 Views)

Re: Spline to pline

09-24-2004 12:41 PM in reply to: colin1234
Hi Colin [code] (command "_.DXFOUT" "Temp.dxf" "_OBJ" MySplinesSelectionSet "" "_VER" "_R12" "_BIN" "_.DXFIN" "Temp.dxf" ) [/code] Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
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.