明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1205|回复: 2

[公告] 求助,哪位高手帮忙改改该段代码????

[复制链接]
发表于 2013-4-24 15:07 | 显示全部楼层 |阅读模式
本帖最后由 lpl 于 2013-4-24 15:12 编辑

(defun c:tt()
   (setq olderror *error*)
     (setq *error* zxx_err)
  (if (not currdir)
         (setq currdir "d:\\")
     )
    (setq of(getfiled "输出文件名" currdir "xls" 1))
    (setq fp1(open of "w"))

  (setq currdir (strcat (vl-filename-directory of) "\\"))  ;记忆本次的路径
  (setq ss(ssget '((-4 . "<or")(0 . "text")(0 . "mtext")(-4 . "or>"))) )
  (SETQ t1 "桩号=")
  (setq a1 0)
  (setq nnn(sslength ss))  
  (repeat nnn
    (setq tt1 (cdr (assoc 1 (entget(ssname ss a1)))))
    (setq d1 (cdr (assoc 10 (entget(ssname ss a1)))))
    (print t1 fp1)
    (princ "\t" fp1)  (princ tt1 fp1)
    (princ "\t" fp1)  (princ "x=" fp1)
    (princ "\t" fp1)  (princ (rtos(cadr d1)2 4) fp1)
    (princ "\t" fp1)  (princ "y=" fp1)
    (princ "\t" fp1)  (princ (rtos(car d1)2 4) fp1)
    (setq a1(+ a1 1))
   )
   (close fp1)

  (princ)

)
(defun zxx_err(msg)

(setq *error* olderror)
( if fp1
     (close fp1)
)
(princ)
)

以上代码坐标标注结果输出不正确,并未按图形的形心坐标输出,哪位大侠帮忙改改,谢谢

 楼主| 发表于 2013-4-25 09:06 | 显示全部楼层
没人气,自己顶下。。。。。。。。。。。。。。。。。
发表于 2013-8-22 16:50 | 显示全部楼层
来学习下,我也遇到了open的问题,不知阁下能否帮小弟个忙?(setq f (open "e:/ceshi/1.dwg" "w"))  (close f)运行完代码后,生成的图形文件无效。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-7 07:10 , Processed in 0.342498 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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