- (defun c:rec ()
- (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)
- )
- (setq p1 (getpoint "\n指定基点: "))
- (if (setq p9 (getcorner p1 "\n对角点:"))
- (command "rectang" "non"p1 "non"p9)
- (progn
- (setq ww (Udist 3 "" "宽度<输入或鼠标直接量取>" ww nil))
- (setq hh (Udist 3 "" "高度<输入或鼠标直接量取>" hh nil))
- (setq p9 (mapcar '+ p1 (list ww hh)))
- (command "rectang" "non"p1 "non"p9)
- )
- )
- (princ)
- )
|