明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 197|回复: 3

[提问] 求问!不知道为什么在text命令选择点时候会出现string nil问题。txt文件附上

  [复制链接]
发表于 2024-5-3 16:03 | 显示全部楼层 |阅读模式
代码如下:


(defun split(str p)
  (setq i (+ 1 (strlen p)))
  (setq sl '())
  (while (setq pa (vl-string-search p str))
    (setq sl (cons (substr str 1 pa) sl)
          str (substr str (+ pa i)))
  )
  (reverse (cons str sl))
)

(defun c:pipe(/)
  (setq filep (getfiled "选择一个管段txt文件" "" "txt" 8))
  (setq f (open filep "r"))
  (setq info (read-line f))
  (while (setq info (read-line f))
    (setq l (split info (chr 9)))
    (command "text" "j" "l" (list (atof(nth 3 l)) (atof(nth 4 l)))  (nth 5 l)
             (strcat (nth 0 l) "," (nth 1 l) "," (nth 2 l)))
)
)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2024-5-3 19:00 | 显示全部楼层
文件编码不对,另存为ANSI编码就可以了

试试我这个

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2024-5-3 16:07 | 显示全部楼层
这是cad运行出现的问题

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2024-5-4 21:44 | 显示全部楼层
高度 角度 都要吧 (command "text" "j" "m" (list (atof(nth 3 l)) (atof(nth 4 l)))  (abs (atof (nth 5 l))) 0 (strcat (nth 0 l) "," (nth 1 l) "," (nth 2 l)))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-18 11:48 , Processed in 0.184184 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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