- 积分
- 554
- 明经币
- 个
- 注册时间
- 2016-9-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
(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 (print str0))
(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 我只想抓取 图号: 后面的代号 可是一直不成功 想请各位高手前辈帮忙
|
|