明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1336|回复: 3

初学者求助

[复制链接]
发表于 2004-5-18 22:57:00 | 显示全部楼层 |阅读模式
(defun c:test()
(setq f (open "e:\\abc.txt" "r"))
(setq t1 (read (read-line f)))
(setq t2 (read (read-line f)))
(command "line" "0,t1" "0,t2" "")
(close f)
(princ)
其中abc.txt   100  t1 200 t2 这个程序在coommand中敲 !t1   为100               !t2   为  200 可就是不能画线,是不是数据类型不对,t1, t2是字符串型的原因,如果是我想把t1 t2 改成另一种类型,怎么改啊,请赐教~.
发表于 2004-5-18 23:10:00 | 显示全部楼层
(command "line" "0,t1" "0,t2" "")
改为 (command "line" (strcat "0," t1) (strcat "0," t2) "")
发表于 2004-5-19 07:52:00 | 显示全部楼层
<BR>这个程序可能需要做如下改动<BR>1. 在最后加个右括号")"<BR>2. Acad的Line命令后面要点表数据,所以要把<BR>                                 (command "line" "0,t1" "0,t2" "")<BR>                 改为<BR>                         (command "line" (list 0 t1)(list 0 t2) "")<BR>                 这个程序就可画线了。<BR>供参考。<BR>下面是改过的程序:<BR>(defun c:test()<BR>         (setq f (open "e:\\abc.txt" "r"))<BR>         (setq t1 (read (read-line f)))<BR>         (setq         t2 (read (read-line f)))<BR>         (command "line" (list 0 t1)(list 0 t2) "")<BR>         (close f)<BR>         (princ)<BR>)<BR>
发表于 2004-5-19 08:01:00 | 显示全部楼层
這樣也可以,只是轉了n個灣! (command "line"
(strcat "0," (rtos T1))
(strcat "0," (rtos T2))
""
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-10-1 10:31 , Processed in 0.165764 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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