I've been working on a lisp to fillet 2 lines then insert a block on the layer of one of the lines selected. With some help/pointers from others (thanks Kent Cooper) I've got it working . . . . mostly. the lisp does not always trim the lines correctly. for instance if you have 2 lines that form a t and I pick the top of the vertical line and the right side of the horisontal line it should fillet the lines to endup looking like an L, correct? well it doesn't always do that.
My question is not only why is it doing this, but is fillet the best way to do it? Would it be better to modify the endpoints? If you modify the endpoints a click could be elimanated by using the new endpoint as the insertion of the block, the problem is I only know about this process I've never seen code to do it let alone know how.
here is the lisp:
(DEFUN C:TEMP (/ oldlay line1)
(setq oldlay (getvar 'clayer)
line1 (car (entsel "\nPick first line: "))
); end setq
(setvar 'clayer (cdr (assoc 8 (entget line1))))
(command "_.fillet" line1 pause)
(command "-insert" "elbow" "s" (getvar 'dimscale) "end,int" pause pause)
(setvar 'clayer oldlay)
(princ)
)
edit: changed Subject line