- (defun ace-getreal (msg default / ret)
- (setq ret (getreal (strcat msg " <" (rtos default) ">:")))
- (if (null ret)
- default
- ret
- )
- )
- (defun ace-addpoint (p)
- (vla-addpoint
- (vla-get-modelspace
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (vlax-3d-point p)
- )
- )
- (setq *dot-span-dist* 1500.0)
- (defun c:tt (/ sx sy p0 p1)
- (if (and
- (setq p0 (getpoint "指定左下角点:"))
- (setq p1 (getcorner p0 "指定右上角点:"))
- )
- (progn
- (setq *dot-span-dist*
- (ace-getreal "输入布点间距" *dot-span-dist*)
- sx 0
- sy 0
- )
- (while (<= (+ (car p0) sx) (car p1))
- (while (<= (+ (cadr p0) sy) (cadr p1))
- (ace-addpoint (trans (list (+ (car p0) sx) (+ (cadr p0) sy)) 1 0))
- (setq sy (+ sy *dot-span-dist*))
- )
- (setq sx (+ sx (/ *dot-span-dist* 2.0)))
- (if (= 0 (rem (/ sx (/ *dot-span-dist* 2.0)) 2))
- (setq sy 0)
- (setq sy (/ *dot-span-dist* 2.0))
- )
- )
- )
- )
- (princ)
- )
|