Originally Posted by
BIG-AL
That link was based on 2 lines not 2 arcs so failed for me.
Sorry been a while since I looked at it, I must have modified it.
Seems to work, give it a try.
Code:
;|draws an arc between 2 lines but does not erase
by Alan H Aug 2015 shared by BIGAL
http://www.cadtutor.net/forum/showthread.php?96989-Connecting-lines-with-an-arc&p=662481&viewfull=1#post662481
Macro: ^P(or C:arcfill (load "arcfill.lsp"));arcfill
Command line: (load "arcfill.lsp") arcfill
=============================================|;
(defun c:arcfill ( / *Error* eend oldsnap pt1 pt2 pt3 pt4 pt5 ent1 ent2 obj1 obj2 obj3 obj4)
(defun *Error* (msg) ; embedded defun
(setvar 'osmode oldsnap)
(setvar "qaflags" 0)
(if (/= s "Function cancelled")
(princ (strcat "\nError: " msg))
)
(princ)
)
; (alert "Arc drawn clockwise from 1st line to 2nd line.")
(setq oldsnap (getvar 'osmode)
eend (cdar(entget(entlast)))
)
(setvar 'Osmode 512)
(setq pt1 (getpoint "\npick 1st line")
ent1 (ssname (ssget pt1) 0)
Ent1Typ (cdr(assoc 0 (cdr(entget ent1))))
pt2 (getpoint "\npick 2nd line")
ent2 (ssname (ssget pt2) 0)
Ent2Typ (cdr(assoc 0 (cdr(entget ent2))))
rad (getdist "\nEnter radius")
obj1 (vlax-ename->vla-object ent1)
obj2 (vlax-ename->vla-object ent2)
)
; (if(or(eq Ent1Typ "POLYLINE")(eq En1Typ "LWPOLYLINE"))
(if(eq En1Typ "LWPOLYLINE")
(progn
(princ "\nGot here")
(vla-copy obj1)
; (setq ss (ssadd) ss (ssadd (entlast)))
; (sssetfirst nil ss)
(setvar "qaflags" 128)
; (command-s "EXPLODE" ss)
; (vl-cmdf "explode") ; Explode the copied object.
(vl-cmdf "explode" (entlast)) ; Explode the copied object.
(princ "\nGot here")
; (setq ent1 (ssname (ssget pt1 '((0 . "LINE,ARC"))) 0)
(setq ent1 (ssname (ssget pt1) 0)
obj1 (vlax-ename->vla-object ent1)
)
)
)
; (if(or(eq Ent2Typ "POLYLINE")(eq En2Typ "LWPOLYLINE"))
(if(eq En2Typ "LWPOLYLINE")
(progn
(vla-copy obj2)
; (alert "Arc drawn clockwise from 1st line to 2nd line.")
(vl-cmdf "explode" (entlast)) ; Explode the copied object.
; (setq ent2 (ssname (ssget pt2 '((0 . "LINE,ARC"))) 0)
(setq ent2 (ssname (ssget pt2) 0)
obj2 (vlax-ename->vla-object ent2)
)
)
) ;
; (Princ "Ent1Typ set to ")(Princ Ent1Typ)
; (Princ "\nEnt2Typ set to ")(Princ Ent2Typ)
; (Princ "\nRadius set to ")(Princ rad)
(command "offset" rad ent1 pt2 "")
(setq obj3 (vlax-ename->vla-object (entlast)))
(command "offset" rad ent2 pt1 "")
(setq obj4 (vlax-ename->vla-object (entlast))
pt5 (vlax-invoke obj3 'intersectWith obj4 acExtendThisEntity) ; Arc Center
pt3 (vlax-curve-getClosestPointto obj2 pt5)
pt4 (vlax-curve-getClosestPointto obj1 pt5)
)
(vla-delete obj3)
(vla-delete obj4)
(command "arc" "C" pt5 pt3 pt4)
(setvar 'osmode oldsnap)
(setvar "qaflags" 0)
)
;(c:arcfill)l