esputro Posted March 5, 2013 Share Posted March 5, 2013 Dear all, does anyone know how to convert circles, arc to Line type..... thanks. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 5, 2013 Share Posted March 5, 2013 try this ; converts an arc to a series of straights (vl-load-com) (setq oldsnap (getvar "osmode")) (setvar "osmode" 0) (setq oldecho (getvar "cmdecho")) (setvar "cmdecho" 0) (while (setq ent (entsel "\nPick arc: ")) (setq obj (vlax-ename->vla-object (car ent))) (if (= div nil) (setq div (getint "\nEnter number of chords: "))) (setq endpt (vlax-curve-getEndPoint obj) totlen (vlax-curve-getDistAtPoint obj endpt) arclen (/ totlen div) chrdpt (vlax-curve-getStartPoint obj) num 1 ) (repeat div (setq newpt (vlax-curve-getPointatDist obj (* arclen num))) (command "line" chrdpt newpt "") (setq num (+ num 1)) (setq chrdpt newpt) ) ;repeat (setq objlst (cons obj objlst)) ) ; end while ;(vlax-for objdel objlst (vlax-delete objdel)) (setvar "cmdecho" oldecho) (setvar "osmode" oldsnap) (princ) Quote Link to comment Share on other sites More sharing options...
esputro Posted March 5, 2013 Author Share Posted March 5, 2013 thanks Bigal for the code but i can't read the function to execute...please advice. Quote Link to comment Share on other sites More sharing options...
MSasu Posted March 5, 2013 Share Posted March 5, 2013 The code posted by BIGAL will defame a serie of arcs into line segments It doesn't define a command, but is intended to be run directly; just paste it on command prompt or on VLIDE console. If you want a command, then: (defun c:ATOL() ;arc to lines ;place BIGAl's code here ) Quote Link to comment Share on other sites More sharing options...
pBe Posted March 5, 2013 Share Posted March 5, 2013 Perhaps it better to prompt for segment distance than number of chords. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 6, 2013 Share Posted March 6, 2013 pBe it was done as a quickie to get around wipeout not supporting arcs and some other software importing autocad dwgs as a underlying frame did not support arcs, a good idea probably an option within the one lisp 2 versions ATOLN & ATOLD Esputro did it meet your needs or do you need like pBe has suggested ? Quote Link to comment Share on other sites More sharing options...
loufe Posted September 17, 2018 Share Posted September 17, 2018 Thanks a bunch BIGAL, worked for me! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 18, 2018 Share Posted September 18, 2018 Good to hear on an old post. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.