本帖最后由 wutao8282 于 2022-4-30 09:28 编辑
- (defun c:tt( / ss ent1 ent2 par c1 c2 r1 r2 i j)
- (setq ss (ssget "x" (list (cons 0 "circle"))) i -1)
- (while (setq ent1 (ssname ss (setq i (1+ i))))
- (setq par (entget ent1) c1 (cdr (assoc 10 par)) r1 (cdr (assoc 40 par)))
- (setq j i)
- (while (setq ent2 (ssname ss (setq j (1+ j))))
- (setq par (entget ent2) c2 (cdr (assoc 10 par)) r2 (cdr (assoc 40 par)))
- (if (and (or (equal r1 15 0.0001)(equal r2 15 0.0001))(< (distance c1 c2)(+ r1 r2 15)))
- (progn (if (equal r1 15 0.0001)(vl-cmdf "change" ent1 "" "P" "c" 1 ""))
- (if (equal r2 15 0.0001)(vl-cmdf "change" ent2 "" "P" "c" 1 ""))
- )
- )
- )
- )(princ)
- )
群高手帮忙写的圆心距检查插件 求助大神帮忙修改一下。现在为圆心距小于30自动红色显示,帮忙修改为检测到心距小于30自动避让 偏移位置使间距超过30即可 |