 - (defun c:ff ()
- "画矩形"
- (defun udist (bit kwd msg def bpt / inp)
- (if def(setq msg(strcat"\n"msg"<"(rtos def)">: ")bit(* 2(fix(/ bit 2))))
- (setq msg(strcat"\n"msg": "))
- )
- (initget bit kwd)
- (setq inp(if bpt(getdist msg bpt)(getdist msg)))
- (if inp inp def)
- )
- (or d(setq d 1000.))
- (or h(setq h 1000.))
- (setq d (Udist 7 "" "矩形长度<输入或鼠标直接量取>" d nil))
- (setq h (Udist 7 "" "矩形高度<输入或鼠标直接量取>" h nil))
- (while (setq p0 (getpoint "\n矩形中心为<退出>: "))
- (setq a (list (* d 0.5) (* h 0.5))
- p1 (mapcar '(lambda (x y) (- x y)) p0 a)
- p2 (mapcar '(lambda (x y) (+ x y)) p0 a)
- )
- (command "rectang" "non" p1 "non" p2)
- )
- (princ)
- )
|