明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 587|回复: 1

[提问] MTEXT 抓取問題

[复制链接]
发表于 2017-8-24 12:03:15 | 显示全部楼层 |阅读模式
(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  
我只想抓取  图号: 后面的代号  
可是一直不成功  
想请各位高手前辈帮忙


 楼主| 发表于 2017-8-24 16:18:43 | 显示全部楼层
問題已解決
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-20 02:28 , Processed in 0.137747 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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