Squirltech Posted September 15, 2021 Share Posted September 15, 2021 Hello all! It's been a while since I've posted but I'm looking for a way to convert multiple single line segments (drawn to represent a circle) into an actual single circle. I've attached a dwg file showing what I'm working with. Let me know if you have any questions. Thanks in advance for any help. BLOCK-SegmentedCircle.dwg Quote Link to comment Share on other sites More sharing options...
eldon Posted September 15, 2021 Share Posted September 15, 2021 My first reaction would be to do it manually by drawing a circle with the option Three points (3P) using the osnap Endpoint, and pick any three points roughly at the third points. Quote Link to comment Share on other sites More sharing options...
Squirltech Posted September 15, 2021 Author Share Posted September 15, 2021 8 minutes ago, eldon said: My first reaction would be to do it manually by drawing a circle with the option Three points (3P) using the osnap Endpoint, and pick any three points roughly at the third points. This is exactly what I did but then... I can do it globally using Overkill, Pedit, Join and Fit. Works like a charm too. Quote Link to comment Share on other sites More sharing options...
eldon Posted September 15, 2021 Share Posted September 15, 2021 Indeed that is also a good solution. But I thought you wanted actual circles, and that method gives polylines. 1 Quote Link to comment Share on other sites More sharing options...
Squirltech Posted September 15, 2021 Author Share Posted September 15, 2021 10 minutes ago, eldon said: But I thought you wanted actual circles, and that method gives polylines. Actual circles was the goal but this will suffice Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 16, 2021 Share Posted September 16, 2021 Something like this. (defun c:pl-c ( / ss ent k x y) (setq ss (ssget)) (setq lst '()) (repeat (setq x (sslength ss)) (setq ent (vlax-ename->vla-object (ssname ss (setq x (1- x))))) (cond ((= (vla-get-objectname ent) "AcDbLwpolyline")(setq pt (vlax-curve-getstartpoint ent))) ((= (vla-get-objectname ent) "AcDbLine")(setq pt (vlax-get ent 'StartPoint))) ) (setq lst (cons pt lst)) ) (setq x 0.0 y 0.0) (repeat (setq K (length lst)) (setq pt (nth (setq k (1- k)) lst)) (setq x (+ (car pt) x)) (setq y (+ (cadr pt) y)) ) (setq pt (list (/ x (length lst))(/ y (length lst)))) (setq rad (distance pt (nth 0 lst))) (command "circle" pt rad) (princ) ) 1 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.