展开全部
;程序写了一个,选择圆,然后选择圆外一点,得到的图形如下
(defun C:tes ( / #k1 #os1 &r1 &tc1 ang1 ent1 ent2 ob1 ob2 pt1 pt2 pt3 x)
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(vl-load-com) ;;加载vlax扩展函数62616964757a686964616fe78988e69d8331333337613864
(setq #os1 (getvar "osmode"))
(if (and (setq ent1 (entsel "\n请选择圆"));1
(setq ent1 (car ent1))
(setq #k1 (entget ent1))
(= (cdr (assoc 0 #k1)) "CIRCLE")
(setq ob1 (vlax-ename->vla-object ent1))
(setq pt1 (getpoint "\n请选择圆外一点"))
)
(progn;;1
(setvar "osmode" 0)
(setq pt2 (cdr (assoc 10 #k1));提取圆心坐标
&tc1 (cdr (assoc 8 #k1));取得圆图层
)
(setq pt3 (mapcar '(lambda (x) (* x 0.5)) (mapcar '+ pt1 pt2)));两点中心点
(setq