几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » ObjectARX(AutoLISP)
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 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自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 03:33 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多