0 Members and 1 Guest are viewing this topic.
Quote from: tombu on July 30, 2015, 03:09:02 PMNice!Thanks! Although it may not be what the OP wanted
Nice!
Quote from: ronjonp on July 30, 2015, 03:11:01 PMQuote from: tombu on July 30, 2015, 03:09:02 PMNice!Thanks! Although it may not be what the OP wanted Turned out it was!I modified it to work with preselected objects as well including arcs & lwpolylines. I use right-click menus for modifying so I needed the preselected option.Code - Auto/Visual Lisp: [Select]; by ronjonp; modified it to work with preselected objects as well including arcs & lwpolylines - by Tom Beauford; (load "AddArcTangents.lsp") AddArcTangents; ^P(or C:AddArcTangents (load "AddArcTangents.lsp"));AddArcTangents; http://www.theswamp.org/index.php?topic=49865.msg550417#msg550417(defun c:AddArcTangents (/ _angle _line e ep p sp tmp) (defun _angle (ename pt / ang clpt e param) (if (and (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getendparam (list ename)))) (setq clpt (vlax-curve-getclosestpointto ename pt)) (setq param (vlax-curve-getparamatpoint ename clpt)) (setq ang (angle '(0 0) (vlax-curve-getfirstderiv ename param))) ) ang ) ) (defun _line (p1 p2 layer) (entmakex (list '(0 . "LINE") '(100 . "AcDbEntity") (cons 8 layer) (cons 10 p1) (cons 11 p2) ) ) ) (princ "\nSelect Arc or Polyline ") (setq tmp (ssget "+.:E:S" '((0 . "arc,lwpolyline")))) (if tmp (progn (setq e (ssname tmp 0) EnTyp (cdr (assoc 0 (entget e))) ) (if (= EnTyp "LWPOLYLINE") (setq tmp (vlax-invoke (vlax-ename->vla-object e) 'explode)) (setq tmp (list (vlax-ename->vla-object e))) ); (if (and (setq e (car (entsel))) (setq tmp (vlax-invoke (vlax-ename->vla-object e) 'explode))) (foreach o tmp (if (= "AcDbArc" (vla-get-objectname o)) (progn (setq sp (vlax-curve-getstartpoint o)) (setq ep (vlax-curve-getendpoint o)) (setq p (inters sp (polar sp (_angle o sp) 1) ep (polar ep (_angle o ep) 1) nil)) (_line sp p "Intersection") (_line ep p "Intersection") (if (= EnTyp "LWPOLYLINE")(vla-delete o)) ) (if (= EnTyp "LWPOLYLINE")(vla-delete o)) ) ) ) ) (princ))Thanks again!