本帖最后由 llsheng_73 于 2022-8-4 11:04 编辑
- (defun tt(e d d1 / n dist);;;e任意曲线,d中间圆间距,d1两端最小距离d1<= 1/2d
- (setq dist(vlax-curve-getdistatparam e(vlax-curve-getendparam e))
- n(fix(/ dist d))
- n(if(>(rem dist d)(+ d1 d1))n(1- n))
- d1(-(*(- dist(* n d))0.5)d))
- (entmakex(mapcar'cons'(0 10 40)(list"circle"(vlax-curve-getstartpoint e)5)))
- (repeat(1+ n)(entmakex(mapcar'cons'(0 10 40)(list"circle"(vlax-curve-getpointatdist e(setq d1(+ d1 d)))5))))
- (entmakex(mapcar'cons'(0 10 40)(list"circle"(vlax-curve-getendpoint e)5))))
(tt(car(entsel"任意曲线"))75 33)
|