明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1220|回复: 2

请教高手lisp不能正常应用

[复制链接]
发表于 2008-10-31 22:10:00 | 显示全部楼层 |阅读模式

小弟最近下雨闲得无聊修改了份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 )
 
)
      
 

发表于 2008-11-1 09:52:00 | 显示全部楼层

没细看,关掉osmode试试:

(setvar "osmode" 0)

发表于 2008-11-1 19:02:00 | 显示全部楼层

不行啊,程序执行完text命令后就返回了style命令,并出现函数被取消的反馈!

看了下,应该没有语法错误的阿

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-9-21 14:05 , Processed in 0.179563 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表