本帖最后由 llsheng_73 于 2023-3-9 15:17 编辑
不管什么线(CIRCLE,ELLIPSE,xline,ray等无所谓起止的除外),提取起点和止点,然后找出容差范围内只出现过一次的点,画圆
- (defun c:tt(/ s a pt e n)
- (and(or(setq a(getreal"容差[1e-3]"))(setq a 1e-3))
- (setq s(ssget'((0 . "*polyline,line,arc,ellipse,spline"))))
- (while(setq e(ssname s 0))
- (ssdel e s)
- (setq pt(vl-list*(vlax-curve-getstartpoint e)(vlax-curve-getendpoint e)pt)))
- (while pt(setq n(length pt))
- (if(=(1- n)(length(setq e(car pt)pt(vl-remove-if(function(lambda(x)(equal x e a)))(cdr pt)))))
- (entmakex(list'(0 . "circle")'(62 . 1)(cons 10 e)'(40 . 1)))))))
|