马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想写一个命令,自动将多点数据文件连接成多义线,并标注点号
目前已经实现多点连接,但缺少标注功能实现,请求各位大侠帮助:
以下是多点连接的LISP:
;;;
(defun c:CX()
;;; 选择要画的数据文件
(setq fn (getfiled "选择数据文件" "//" "" 4))
(setq f (open fn "r"))
;;
(setq n 0)
(command "Pline")
(while (setq se (read-line f))
;; 数据实数付值
(setq se (strcat se "\n"))
(setq len (strlen se))
(setq L '() k 1 s_str "" p nil)
(while(<= k len)
(setq one (substr se k 1))
(if(or (= one":") (= one",") (= one " ") (= one (chr 9)) (= one "\n") (= one "Space") (= one "Tab"))
(if p
(progn
(if(= (type (read s_str)) 'SYM)
(setq L (cons s_str L))
(setq L (cons (read s_str) L))
)
(setq s_str "" p nil)
))
(setq s_str (strcat s_str one) p T)
)
(setq k(+ 1 k))
)
(setq L (reverse L))
;;在此修改文件输入顺序格式
(setq z 0.0)
(setq x (nth 0 L))
(setq y (nth 1 L))
(if (> (length L) 2)
(setq z (nth 2 L)))
(setq pt (list x y z))
(command pt)
(print n)
(setq n (+ 1 n))
)
(command "")
)
数据文件格式:
X坐标 Y坐标
0 0
200 974
500 300
想增加一项功能:在每个点位标注点号
想实现的数据文件格式
点号 X坐标 Y坐标
1 0 100
2 200 974
3 500 300
想实现的最后效果图见附件
广告位,后台可以设置,支持js
您好,您暂时不能浏览帖子的全部内容,请 登录
| 没有账号? 请 注册