乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 59|回复: 1

[编程交流] 提取AutoCAD文本(非属性

[复制链接]

170

主题

347

帖子

174

银币

中流砥柱

Rank: 25

铜币
870
发表于 2022-7-5 16:25:51 | 显示全部楼层 |阅读模式
有没有办法通过在块插入中拾取文本来将文本提取到嵌入到块中的变量中。
 
我对提取属性不感兴趣。我在找东西
这将提取autocad文本(不需要多行文字)。只有AutoCAD文本。
我会看一些从一个区块中提取多行文字的东西。
 
 
 
我正在寻找的东西在Lisp,或VB。net或C#net。我想任何编程语言
可与AutoCAD一起使用。
 
任何解决方案。
 
非常感谢。
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:46:37 | 显示全部楼层
这是一个旧的李mac,我创建了一个两行文字块
 
  1. ; by lee-mac
  2. ([color=blue]defun[/color] get-block-entities ( blk [color=blue]/[/color] ent lst )    [color=green];; Define the function, declare local variables[/color]        ([color=blue]if[/color] [color=green];; If the following returns a non-nil value[/color]        [color=green];; i.e. if the block exists in the drawing[/color]        ([color=blue]setq[/color] ent ([color=blue]tblobjname[/color] [color=maroon]"block"[/color] blk)) [color=green];; get the BLOCK entity[/color]        ([color=blue]while[/color] ([color=blue]setq[/color] ent ([color=blue]entnext[/color] ent))            [color=green];; Step through the entities in the block definition[/color]                        ([color=blue]setq[/color] lst ([color=blue]cons[/color] ent lst))            [color=green];; Construct a list of the block components[/color]                    ) [color=green];; end WHILE[/color]            ) [color=green];; end IF[/color]        ([color=blue]reverse[/color] lst) [color=green];; Return the list[/color]    ) [color=green];; end DEFUN[/color]

 
然后我做到了
 
  1. (entget (nth 0 lst))
  2. ((-1 . <Entity name: 7ffffb4cd60>) (0 . "TEXT") (330 . <Entity name: 7ffffb4cd20>) (5 . "129EE") (100 . "AcDbEntity") (67 . 0) (8 . "DEFAULT") (100 . "AcDbText") (10 -0.930106 -5.26808 0.0) (40 . 2.5) (1 . "bbbb") (50 . 0.0) (41 . 0.7) (51 . 0.0) (7 . "hfs_simplex") (71 . 0) (72 . 0) (11 0.0 0.0 0.0) (210 0.0 0.0 1.0) (100 . "AcDbText") (73 . 0))
  3. ; look for assoc 0 is "Text"
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-12 12:36 , Processed in 0.824909 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表