查看单个帖子
旧 2009-04-27, 12:54 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 请教高手lisp不能正常应用

请教高手lisp不能正常应用
www.dimcax.com
请教高手lisp不能正常应用
小弟最近下雨闲得无聊修改了份lisp小程序,可是tm1~tm9和图块ac50tk死活显示不出来,程序如下,请高手给予正解,谢谢
(defun c:jtk()
(setq xinan (getpoint "\n请拾取或输入1:500图框的西南图廓点坐标:"))
(setq tm (getstring "\n请输入图名:"))
(command "layer" "s" "tk" "")
(setq x0 (nth 0 xinan) y0 (nth 1 xinan) h0 (nth 2 xinan))
(setq xk (/ x0 1000))
(setq yk (/ y0 1000))
(setq x (rtos xk 2 2))
(setq y (rtos yk 2 2))
(setq tmy1 (rtos (- (atof y) 0.25) 2 2))
(setq tmx1 (rtos (- (atof x) 0.25) 2 2))
(setq tmyy (rtos (+ (atof y) 0.25) 2 2))
(setq tmxx (rtos (+ (atof x) 0.25) 2 2))
(setq th (strcat x "-" y))
(setq dtk1 (polar xinan 0 257.5))
(setq dth (polar dtk1 1.570796 125))
(setq dtkk (polar xinan 0 261.5))
(setq dtm (polar dtkk 1.570796 125))
(command "style" "winht" "simhei.ttf" "3.0" "0.8" "" "" "")
(command "text" "j" "m" dtm "" tm)
(command "style" "winht" "simhei.ttf" "3.0" "0.8" "" "" "")
(command "text" "j" "m" dth "" th)
(setq tm1(strcat tmxx "-" tmy1))
(setq tm2(strcat tmxx "-" y))
(setq tm3(strcat tmxx "-" tmyy))
(setq tm4(strcat x "-" tmy1))
(setq tm6(strcat x "-" tmyy))
(setq tm7(strcat tmx1 "-" tmy1))
(setq tm8(strcat tmx1 "-" y))
(setq tm9(strcat tmx1 "-" tmyy))
(setq dtk (polar xinan 0 250))
(setq dtm1(polar dtk 0 15.5))
(setq dtm2(polar dtm1 1.570796 7.5))
(setq dtm3(polar dtm1 1.570796 15))
(setq dtm4(polar dtk 0 11.5))
(setq dtm6(polar dtm4 1.570796 15))
(setq dtm7(polar dtk 0 7.5))
(setq dtm8(polar dtm7 1.570796 7.5))
(setq dtm9(polar dtm7 1.570796 15))
(command "style" "hz" "rs.shx" "1.2" "0.8" "" "" "")
(command "text" "j" "m" dtm1 "" tm1)
(command "text" "j" "m" dtm2 "" tm2)
(command "text" "j" "m" dtm3 "" tm3)
(command "text" "j" "m" dtm4 "" tm4)
(command "text" "j" "m" dtm6 "" tm6)
(command "text" "j" "m" dtm7 "" tm7)
(command "text" "j" "m" dtm8 "" tm8)
(command "text" "j" "m" dtm9 "" tm9)
(command "insert" "c:\\cass70\\blocks\\ac50tk.dwg" xinan "xyz" "1" "1" "1" "")
(command "layer" "s" "0" "")
(command "redraw")
(command "zoom" "e")
(princ "\n * 图幅整饰完成 * ")
(print )

)


d
没细看,关掉osmode试试:
(setvar "osmode" 0)
d
不行啊,程序执行完text命令后就返回了style命令,并出现函数被取消的反馈!
看了下,应该没有语法错误的阿
d
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)