注意:LISP语言对大小写不敏感,,,jd和JD是一样的另,你的过程比较紊乱,给你稍微优化了一下:- ;;;等高线高程连续计算重写程序
- ;;;角度转化
- ;;;主程序
- (defun c:LXBGCX(/ oldcmd SS TL zg jd JDT JS jj p pt1 ent)
- (setq oldcmd(getvar "cmdecho"))
- (SETvar "CMDECHO" 0)
- (PRINC "\n选择已标注好的初始高程:")
- (SETQ SS (SSGET '((0 . "MTEXT"))) ent (ssname ss 0))
- (SETQ TL (CDR (ASSOC 1 (entget ent))))
- (SETQ zg (CDR (ASSOC 40 (entget ent))))
- (SETQ jd (CDR (ASSOC 50 (entget ent))))
- (setq jj(distof TL 2))
- (setq p(getreal "\n设置步距[上+,下-]<2>:"))
- (if (= p nil) (setq p 2))
- (while (setq pt1 (getpoint "\n输入重写点:"))
- (setq jj(+ jj p))
- (setq JDT (rtos jj 2 3))
- (command "text" "j" "m" pt1 zg jd JDT)
- )
- (princ "\n高程标注完成,请检查!")
- (SETvar "CMDECHO" oldcmd)
- )
|