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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(AutoLISP) (http://www.dimcax.com/hust/forumdisplay.php?f=178)
-   -   [原创]点击圆存坐标并编号可以加前缀 (http://www.dimcax.com/hust/showthread.php?t=10841)

yang686526 2009-04-25 10:18 PM

[原创]点击圆存坐标并编号可以加前缀
 
[原创]点击圆存坐标并编号可以加前缀
www.dimcax.com
[原创]点击圆存坐标并编号可以加前缀
defun c:hk()
(command "cmdecho" "0")
(command "layer" "m" "hk" "c" "1" "" "")
(setq f (open (getfiled "坐标文件保存到" "c:" "txt" 1) "w"))
(setq jj (strcase (getstring"请输入前缀:")))
(setq n 1)
(while
(setq na (entsel"\n注意必须要点击编号的圆 有问题发邮件到:"))
(setq xy (cdr (assoc 10 (entget (car na)))))
(setq x (nth 0 xy))
(setq y (nth 1 xy))
(setq zg (* 3 (cdr (assoc 40 (entget (car na))))))
(setq yy (+ y zg))
(setq zb (list x yy))
(setq kk (rtos n 2 0))
(setq k (strcat jj kk))
(command "layer" "s" "hk" "")
(command "text" "j" "m" zb zg "0" k "")
(setq ss (strcat k "," (rtos (nth 0 xy) 2 3) "," (rtos (nth 1 xy) 2 3)))
(write-line ss f)
(setq n (1+ n))
(princ ss)
(princ)
)
)

通过工具菜单->加载应用程序 可加载该程序,然后可直接在命令行输入相关命令运行。如需要每次启动时均加载该程序,则可以将该文件放在启动组中。
文件预览:
d


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