明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 品茗新秀

[提问] 如何分解出块中的文字,其它都不会

[复制链接]
发表于 2015-1-30 08:50:53 | 显示全部楼层
品茗新秀 发表于 2015-1-30 01:18
如果有多个,框选就更好了

  1. (defun c:tt (/ i ss)
  2.   (setq ss (ssget '((0 . "INSERT"))))
  3.   (if (not (null ss))
  4.     (progn
  5.       (setq i 0)
  6.       (repeat (sslength ss)
  7.         (detachattrib (ssname ss i))
  8.         (setq i (+ i 1))
  9.       )
  10.     )
  11.   )
  12. )


  13. (defun detachattrib (ent / dxf txt)
  14.   (while
  15.     (and (setq ent (entnext ent))
  16.          (setq dxf (entget ent))
  17.          (/= "SEQEND" (cdr (assoc 0 dxf)))
  18.          (= "ATTRIB" (cdr (assoc 0 dxf)))
  19.     )


  20.      (setq txt (subst '(0 . "TEXT") '(0 . "ATTRIB") dxf)
  21.            txt (vl-remove-if '(lambda (e) (member (car e) '(-1 330 5 2 70 73 74 280))) txt)
  22.      )
  23.      (entmake txt)

  24.      (setq dxf (subst '(1 . "") (assoc 1 dxf) dxf))
  25.      (entmod dxf)
  26.   )
  27. )



非常简洁,能不能把子函数发出来学习一下

哪里用到什么子函数?

评分

参与人数 1明经币 +1 收起 理由
品茗新秀 + 1 很给力!

查看全部评分

回复

使用道具 举报

发表于 2015-3-28 11:31:41 | 显示全部楼层
果然是大神啊......
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-7-1 15:47 , Processed in 0.154041 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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