异等分偏移(自己取的)
间隔固定值等分偏移对象。
初步代码,以后继续完善,希望得到高人指点。。
效果如图:
-
- (defun c:test(/ ds1 ds2 reptime ent1 pt1 div1 )
- (setq ds1(getdist "\n需要等分总长度:")
- DS2 (GETDIST "\n固定等分距离值:")
- div1 (getint "\n请输入等分数目:")
- reptime 1
- )
- (setq ent1(entsel "\n请选择偏移对象:")
- pt1(getpoint "\n请指定偏移方向:"))
- (repeat div1
- (setq ptx1 (list (+ (nth 0 pt1) ds1) (+ (nth 1 pt1) ds1))
- dsx1 (/ (- ds1 (* ds2 (/ (+ div1 1 ) 1.0))) (/ div1 1.0))
- )
- (command "_.offset" ds2 ent1 ptx1 "")
- (setq ent1(entlast))
- (command "_.offset" dsx1 ent1 ptx1 "")
- (setq ent1(entlast)
- reptime (+ reptime 1))
- )
- )
|