DECHAL Posted September 4, 2014 Posted September 4, 2014 Hi All, I've a drawing with 2500 circles on it. Only thing is the they are not circles, they are polylines. How can I quickly replace Polylines with Circles or find the centre of all these polylines. Any help please. Regards, DECHAL. Quote
RobDraw Posted September 4, 2014 Posted September 4, 2014 Can you post an example? I drew a circle with a polyline and center OSnap worked. Are you familiar with the M2P object snap? Quote
DECHAL Posted September 4, 2014 Author Posted September 4, 2014 RobDraw, Part of drawing attached. Regards, DECHAL SAMPLE.dwg Quote
RobDraw Posted September 4, 2014 Posted September 4, 2014 Those are splines, not polylines in the blocks. Did you try the M2P osnap? It works in this case. Unless there is a good reason to have circles drawn with splines, I would change the block definition to be a circle. Quote
SLW210 Posted September 4, 2014 Posted September 4, 2014 I had solutions to your question, but your drawing shows Splines made in a circle shape that are blocks, not Closed Polylines. I'll move your thread to the AutoLISP, Visual LISP & DCL Forum. Maybe someone knows of some code to convert them. Quote
RobDraw Posted September 4, 2014 Posted September 4, 2014 SLW, they are blocks and easily changed to circles. Please look at my response, it has two solutions to this situation. No code necessary. Quote
marko_ribar Posted September 4, 2014 Posted September 4, 2014 Here, try this simple code... (defun c:convblockspls2circles ( / ss i bl bln spl spldxf10 p1 p2 p3 ) (prompt "\nSelect blocks that conatain circular splines") (setq ss (ssget "_:L" '((0 . "INSERT") (2 . "block*")))) (setq i -1) (while (setq bl (ssname ss (setq i (1+ i)))) (setq bln (cdr (assoc 2 (entget bl)))) (command "_.explode" bl) (while (> (getvar 'cmdactive) 0) (command "")) (setq spl (entlast)) (setq spldxf10 (member (assoc 10 (entget spl)) (entget spl))) (setq p1 (cdr (nth 0 spldxf10))) (setq p2 (cdr (nth 3 spldxf10))) (setq p3 (cdr (nth 6 spldxf10))) (entdel spl) (command "_.-purge" "_b" bln "_n") (while (> (getvar 'cmdactive) 0) (command "")) (command "_.circle" "_3p" "_non" p1 "_non" p2 "_non" p3) ) (princ) ) (defun c:cbs2c nil (c:convblockspls2circles)) HTH, M.R. Quote
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.