- 积分
- 157
- 明经币
- 个
- 注册时间
- 2010-6-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
这程序为什么在cad06版运行正常,08版不能提取汉字??
紧急求助,这程序为什么在cad06版运行正常,08版不能提取汉字(均在相应的天河版本下)
(defun c:tittle( / )
(setq aa nil) (setq bb nil)
(setq aa (ssget "X" '((0 . "INSERT") (2 . "PC_MXB_BLOCK"))))
(setq bb (ssget "X" '((0 . "INSERT") (2 . "PC_TITLE_BLOCK"))))
(setvar "filedia" 0)
(command "-attext" "o" bb "" "" "C:/_taoyu/tylsp/天河转XT/tittle.txt" "d:/cap.txt" );提取标题栏属性
(command "-attext" "o" aa "" "" "C:/_taoyu/tylsp/天河转XT/mxbtem.txt" "d:/mxbinf.txt");提取明细表属性
(setvar "filedia" 1)
(SETQ REPN (- (SSLENGTH BB) 1)) ;当有多个图框时
(setq fcap (open "d:/cap.txt" "r"))
(setq capline (read-line fcap))
(setq repn (- repn 1))
(REPEAT REPN
(setq secondline (read-line fcap))
(IF (> secondline capline)
(SETQ capline SECONDLINE))
) ;取大的值为标题栏信息___填写了总重量的字符串值大
(close fcap)
(readcapl capline);获取标题栏信息
(setq filename (strcat (getvar "dwgprefix") (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)) ".MXB"))
(setq fp (open filename "w"))
(princ curtuhao fp)
(princ "|" fp)
(princ curname fp)
(princ "|" fp)
(princ curwt fp)
(princ "|" fp)
(princ allwt fp)
(princ "|" fp)
(princ zhonghao fp)
(princ "|" fp)
(princ daihao fp)
(princ "|" fp)
(princ (getvar "dimscale") fp)
(princ "|" fp)
(princ (if (= "" totalpage) 0 totalpage) fp)
(princ "|" fp)
(princ 0 fp)
(princ "|" fp)
(princ 0 fp)
(princ "|" fp)
(princ (getvar "extmax") fp)
(princ "\n" fp)
(setq repn (sslength aa)) (setq fmxb (open "d:/mxbinf.txt" "r"))
(repeat repn
(setq line (read-line fmxb) n 8 strjs 1 word "" character "T")
(while (/= "" character)
(setq character (substr line strjs 1) strjs (+ strjs 1))
(if (and (/= "'" character) (/= "," character))
(setq word (strcat word character))
)
(if (or (= "," character) (= "" character))
(if (or (= 3 n) (= 4 n) (= 2 n))
(if (/= "" word) (princ word fp) (princ 0 fp))
(if (/= "" word) (princ word fp) (princ "none" fp))
)
)
(if (= "" character) (princ (strcat "|" curtuhao "\n") fp))
(if (= "," character) (setq word "" n (- n 1)))
(if (= "," character) (princ "|" fp))
);while
);end rep
(close fp) (close fmxb)
);end def
(defun readcapl(capline / )
(setq n 15 ) (setq strjs 1) (setq word "")
(while (> n 1)
(setq character (substr capline strjs 1) strjs (+ strjs 1))
(if (and (/= "'" character) (/= "," character))
(setq word (strcat word character))
)
(if (= "," character)
(if (= 15 n)
(setq curtuhao word)
(if (= 14 n)
(setq curname word)
(if (= 13 n)
(setq allwt word)
(if (= 12 n)
(setq zhonghao word)
(if (= 11 n)
(setq daihao word)
(if (= 2 n)
(setq totalpage word)
)
)
)
)
)
)
)
(if (= "," character )
(setq n (- n 1) word "")
)
)
(if (or (= allwt "") (= allwt nil)) (setq allwt 0)) ;没有总重值时,自动赋0,否则排序时会出错
|
|