(setq a 0.1)控制精度 - (defun c:test( / ents start_ang end_ang pt_center r ss i ent pt ang a)
- (defun between(ang ang1 ang2)
- (cond
- ((< ang1 ang2) (and (>= ang start_ang) (<= ang end_ang)))
- ((> ang1 ang2) (or (>= ang start_ang) (<= ang end_ang)))
- )
- )
- (setq a 0.1)
- (setq ents (entget (car (entsel "选择圆弧..."))))
- (setq start_ang (cdr (assoc 50 ents)))
- (setq end_ang (cdr (assoc 51 ents)))
- (setq pt_center (cdr (assoc 10 ents)))
- (setq r (cdr (assoc 40 ents)))
- (setq ss (ssget "x" '((0 . "text,mtext"))))
- (setq i 0)
- (repeat (sslength ss)
- (setq ent (ssname ss i))
- (setq pt (cdr (assoc 10 (entget ent))))
- (if (and (equal r (distance pt pt_center) a) (between (angle pt_center pt) start_ang end_ang))
- (entdel ent)
- )
- (setq i (1+ i))
- )
- (princ)
- )
-
|