MTEXT 抓取問題
(defun c:tyy ()(setq
SS (ssget
'((0 . "REGION,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE,ARC,INSERT"))
)
)
(setq ent (car (entsel "\n图号:")))
(setq dxf (entget ent))
(setq str0 "")
(setq txt (cdr (assoc 1 dxf)))
(setq txt (vl-string-subst "" "{" txt))
(setq txt (vl-string-subst "" "}" txt))
(while (setq n (vl-string-search ";" txt))
(if (= (setq str (substr txt 1 1)) "\\")
(setq txt (substr txt (+ n 2)))
(progn
(setq str0 (strcat str0 (substr txt 1 1)))
(setq txt (substr txt 2))
)
)
)
(setq str0 (strcat str0 txt))
(setq w2 (printstr0))
(if(findfile (SETQ w3 (STRCAT "d:/N/" w2 ".dxf" )) )
(alert(strcat w3"已存在"))
(progn
(command "filedia" "0")
(command "dxfout" w3 "O" SS "" "v" "R12" "")
(command "filedia" "1")))
(princ)
)
上面代码只能抓取一般MTEXT但是遇到整体的内容 没办法指定例如: 客户 : AAAA 图号 : P12345 比例: 1:1我只想抓取图号: 后面的代号可是一直不成功想请各位高手前辈帮忙
問題已解決
页:
[1]