明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1941|回复: 3

讀取圖面中的孔位置寫出座標至檔案.txt中

[复制链接]
发表于 2005-2-4 10:32:00 | 显示全部楼层 |阅读模式
;;读取图面中的孔位置写出座标至档案.txt中
(defun c:cirpt()
(setq ffn (getfile "选取档案" "" "txt" 1))
(setq ff (open ffn "w"))
(princ "\n选取孔穴:")
(setq ss (ssget)) (setq i 0)
(repeat (sslength ss)
(setq ssn (ssname ss i))
(setq sstyp (cdr (assoc 0 (entget ssn))))
(if (= sstyp "CIRCLE")
(progn
(setq c_pt (cdr (assoc 10 (entget ssn))))
(princ (car c_pt) ff) (princ "" ff)
(princ (cadr c_pt) ff) (princ "" ff)
(princ (caddr c_pt) ff) (princ "\n" ff) )
)
)
(setq i (1+ i)) )
(close ff)
(princ (strcat "\n档案名称==>" ffn))
(prin1)
)
发表于 2005-2-24 17:27:00 | 显示全部楼层
用不到吹牛
发表于 2005-2-25 14:01:00 | 显示全部楼层
发贴心情
用不到吹牛
发表于 2005-2-25 17:29:00 | 显示全部楼层
(defun c:cirpt (/ ffn ff)
(setq ffn (getfiled "选取档案" "" "txt" 1))
(setq ff (open ffn "w"))
(princ "\n选取孔穴:")
(setq ss (ssget))
(setq i 0)
(repeat (sslength ss)
(setq ssn (ssname ss i))
(setq sstyp (cdr (assoc 0 (entget ssn))))
(if (= sstyp "CIRCLE")
(progn
(setq c_pt (cdr (assoc 10 (entget ssn))))
(princ (car c_pt) ff)
(princ "" ff)
(princ (cadr c_pt) ff)
(princ "" ff)
(princ (caddr c_pt) ff)
(princ "\n" ff)
)
)
(setq i (1+ i))
)
(close ff)
(princ (strcat "\n档案名称==>" ffn))
(prin1)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 16:33 , Processed in 0.174374 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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