0 Members and 1 Guest are viewing this topic.
(defun c:Test ( / doc elst selMain selSub) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (while (and (setq selMain (entsel "\nSelect main (KEEP) curve or Enter: ")) (setq selSub (entsel "\nSelect sub curve or Enter: ")) ) (vla-startundomark doc) (setvar 'cmdecho 0) (setq elst (entget (car selMain))) (command "_.fillet" selMain selSub) (entmod elst) (setvar 'cmdecho 1) (vla-endundomark doc) ) (princ))
roy_043,Thank you very much for that. It works great! Is there a way you can make it keep first line selected? When I get this message "Select main (KEEP) curve or Enter:" I have to pick main line to continue on to the next fillet.Thank you very much,David
FWIW I can't get this code to work in AutoCAD 2019 for some reason?
(setvar 'trimmode 1)
;| Fillet toby: roy_043http://www.theswamp.org/index.php?topic=55803.msg598594#msg598594(or C:Fillet2 (load "Fillet2.lsp"));Fillet2(load "Fillet2.lsp") Fillet2=======================================================|;(defun c:Fillet2 ( / doc elst selMain selSub) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (while (and (setq selMain (entsel "\nSelect main (keep unchanged) curve or Enter: ")) (setq selSub (entsel "\nSelect curve to fillet to main or Enter: ")) ) (vla-startundomark doc) (setvar 'trimmode 1) (setvar 'peditaccept 1) (setvar 'cmdecho 0) (setq elst (entget (car selMain))) (command "_.fillet" selMain selSub) (entmod elst) (setq ss (ssadd) ss (ssadd (car selSub) ss) ss (ssadd (entlast) ss) ); setq (command "_.pedit" "M" ss "" "J" 0.0 "") (setvar 'cmdecho 1) (vla-endundomark doc) ) (princ))
; draws an arc between 2 lines but does not erase; by Alan H Aug 2015(defun c:arcfill ( / pt1 pt2 pt3 pt4 pt5 obj1 obj2 obj3 obj4 obj5 obj6 rad) (setq oldsnap (getvar 'osmode))(setvar 'Osmode 512)(setq pt1 (getpoint "\npick 1st line for trim near end"))(setq obj1 (ssname (ssget pt1) 0))(setq obj5 (vlax-ename->vla-object obj1))(setq stpt (vlax-curve-getstartpoint obj5 ))(setq endpt (vlax-curve-getendpoint obj5))(setq d1 (distance pt1 stpt))(setq d2 (distance pt1 endpt))(setq pt2 (getpoint "\npick 2nd line to remain"))(setq obj2 (ssname (ssget pt2) 0))(setq obj6 (vlax-ename->vla-object obj2))(setq rad (getdist "\nEnter radius"))(setvar 'osmode 0)(command "offset" rad Obj1 pt2 "")(setq obj3 (vlax-ename->vla-object (entlast)))(command "offset" rad Obj2 pt1 "")(setq obj4 (vlax-ename->vla-object (entlast)))(setq pt5 (vlax-invoke obj3 'intersectWith obj4 acExtendThisEntity))(setq pt3 (vlax-curve-getClosestPointto obj6 pt5))(setq pt4 (vlax-curve-getClosestPointto obj5 pt5))(vla-delete obj3)(vla-delete obj4); need a check direction(command "arc" "C" pt5 pt3 pt4)(if (not AH:Butts)(load "Multi Radio buttons.lsp"))(if (= but nil)(setq but 1))(setq ans (ah:butts but "h" '("Flip arc" "Yes" "No")))(if (= ans "Yes")(progn (command "erase" "last" "")(command "arc" "C" pt5 pt4 pt3)))(if (< d1 d2) (vla-put-startpoint obj5 (vlax-3d-point pt4))(vla-put-endpoint obj5 (vlax-3d-point pt4)))(setvar 'osmode oldsnap))(c:arcfill)