修改了下6楼的程序,单只能选择圆弧,单常用的多段线,哪位大侠能把多段线里的圆弧也加进去呢?
(defun C:XNJD (/ p1 p2 p3 p4 p5) (setq p1 (entsel "\n选取一段圆弧: ")) ;获取图元名 (if p1 (progn (setq p0 (entget (car p1))) ;获取图元表 (setq p1 (cdr (assoc 0 p0))) ;获取表的0位置元素即类型ARC ) ) (if (/= p1 "ARC") (prompt "\n选择的不是圆弧,请再试...") ) (setq CEN (cdr (assoc 10 p0))) ;获取圆弧圆心 (setq RAD (cdr (assoc 40 p0))) ;获取圆弧半径 (setq JDQ (cdr (assoc 50 p0))) ;获取起始角度 (setq JDZ (cdr (assoc 51 p0))) ;获取终止角度
(setq p1 (polar CEN JDQ RAD) ;获取圆弧起始点 p2 (polar CEN JDZ RAD) ;获取圆弧终止点 p3 (polar p1 (+ (/ pi 2) JDQ) RAD) ;获取起始点切线方向的半径点 p4 (polar p2 (+ (/ pi 2) JDZ) RAD) ;获取终止点切线方向的半径点 p5 (inters p1 p3 p2 p4 nil) ;切线交点 ) (if (not p5) (prompt "\n没有交点...") ) (command "_.line" p1 p5 "") (command "_.line" p2 p5 "")
(princ) )
|