求助,哪位高手帮忙改改该段代码????
本帖最后由 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)
)
以上代码坐标标注结果输出不正确,并未按图形的形心坐标输出,哪位大侠帮忙改改,谢谢
没人气,自己顶下。。。。。。。。。。。。。。。。。 来学习下,我也遇到了open的问题,不知阁下能否帮小弟个忙?(setq f (open "e:/ceshi/1.dwg" "w"))(close f)运行完代码后,生成的图形文件无效。
页:
[1]