本帖最后由 作者 于 2004-12-25 19:44:14 编辑
错误:(setq fir (list (+(car fir) 420) cadr fir))→(setq fir (list (+(car fir) 420) (cadr fir)))
改成这样会更好。- (defun c:tuhao (/ os pt pt2 m text)
- (cmndla0)
- (setq pt (getpoint "\n请选定图框的左下角")
- no1 (@ureal 1 "" "\n请输入图号号码" no1)
- text no1
- no2 (@ureal 1 "" "\n请输入本行图框数目" no2)
- )
- (setvar "osmode" 0)
- (setvar "cmdecho" 0)
- (mkla"图号"4)
- (command ".undo" "BE")
- (repeat (fix no2)
- (setq pt2 (polar pt (/ pi 75) 358)
- m (rtos text 2 0)
- )
- (command "text" pt2 "4" "0" (strcat "SS-SF-" m))
- (setq pt (list (+ (car pt) 420) (cadr pt))
- text (+ text 1)
- )
- )
- (command ".undo" "E")
- (cmdla1)
- )
- (defun @ureal (bit kwd msg def / inp)
- (if def
- (setq msg (strcat "\n" msg "<" (rtos def 2) ">: ")
- bit (* 2 (fix (/ bit 2)))
- )
- (setq msg (strcat "\n" msg ": "))
- )
- (initget bit kwd)
- (setq inp (getreal msg))
- (if inp
- inp
- def
- )
- )
- (defun CMDLA0 ()
- (setq cmdech (getvar "CMDECHO"))
- (setq oom (getvar "orthomode"))
- (setq osm (getvar "osmode"))
- (SETQ LA (getvar "clayer"))
- (setq rmode (getvar "regenmode"))
- (setq pw (getvar "plinewid"))
- (setvar "regenmode" 0)
- (setvar "CMDECHO" 0)
- (princ)
- )
- (defun CMDLA1 ()
- (setvar "CMDECHO" cmdech)
- (setvar "orthomode" oom)
- (setvar "osmode" osm)
- (setvar "clayer" LA)
- (setvar "regenmode" rmode)
- (setvar "plinewid" pw)
- (princ)
- )
- (defun mkla (name color)
- (If (= (Tblsearch "layer" name) nil)
- (Command "layer" "m" name "c" color name "")
- (Command "layer" "t" name "s" name "c" color name "")
- )
- )
|