乐筑天下

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

[编程交流] 动态块-属性

[复制链接]

7

主题

19

帖子

12

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-5 19:14:27 | 显示全部楼层
  1. (defun LM:GetAttributeValue ( blk tag )
  2. ;; © Lee Mac 2010
  3. (vl-some
  4.    (function
  5.      (lambda ( attrib )
  6.        (if (eq tag (vla-get-Tagstring attrib))
  7.          (vla-get-TextString attrib)
  8.        )
  9.      )
  10.    )
  11.    (vlax-invoke blk 'GetAttributes)
  12. )
  13. )

好啊知道了。。。我切换到:
  1. ;; Get Attribute Value  -  Lee Mac
  2. ;; Returns the value held by the specified tag within the supplied block, if present.
  3. ;; blk - [vla] VLA Block Reference Object
  4. ;; tag - [str] Attribute TagString
  5. ;; Returns: [str] Attribute value, else nil if tag is not found.
  6. (defun LM:getattributevalue ( blk tag / enx )
  7.    (if (= "ATTRIB" (cdr (assoc 0 (setq enx (entget (setq blk (entnext blk)))))))
  8.        (if (= (strcase tag) (strcase (cdr (assoc 2 enx))))
  9.            (cdr (assoc 1 enx))
  10.            (LM:getattributevalue blk tag)
  11.        )
  12.    )
  13. )

现在开始工作了
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 19:20:11 | 显示全部楼层
好东西
 
您可以参考我的网站获取最新版本的功能;为了避免这个问题,我重命名了Visual LISP函数。
回复

使用道具 举报

7

主题

19

帖子

12

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-5 19:23:25 | 显示全部楼层
编辑:已解决
 
谢谢
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 20:37 , Processed in 1.046608 second(s), 67 queries .

© 2020-2025 乐筑天下

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