明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1008|回复: 7

如何获得某个标注对象的全局比例?

[复制链接]
发表于 2013-3-26 23:33 | 显示全部楼层 |阅读模式
我用这个(entget(car(entsel)))无法查到,烦请懂的帮忙下
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2013-3-27 08:12 | 显示全部楼层
(cdr (assoc 40 (tblsearch (cdr (assoc 3 (entget(car(entsel))))))))
发表于 2013-3-27 08:42 | 显示全部楼层
  1. ;;;指定标注对象,获取全局比例
  2. (and (setq en (car (entsel)))
  3.      (or (setq tmp
  4.                 (cdr
  5.                   (assoc 1040
  6.                          (cdadr (assoc -3 (entget en '("ACAD"))))
  7.                   )
  8.                 )
  9.          )
  10.          (setq tmp
  11.                 (cdr
  12.                   (assoc 40
  13.                          (tblsearch "DIMstyle" (cdr (assoc 3 (entget en))))
  14.                   )
  15.                 )
  16.          )
  17.      )
  18.      (print tmp)
  19. )
 楼主| 发表于 2013-3-27 10:15 | 显示全部楼层
USER2128 发表于 2013-3-27 08:12
(cdr (assoc 40 (tblsearch (cdr (assoc 3 (entget(car(entsel))))))))

谢谢,你这一句很简洁,但运行时错误,出现:
错误: 参数太少
 楼主| 发表于 2013-3-27 10:17 | 显示全部楼层
本帖最后由 clh521 于 2013-3-27 10:20 编辑
zml84 发表于 2013-3-27 08:42


非常感谢:你的程序运行正确,帮了我大忙

但是对于引线标注就不正确了
发表于 2013-3-27 13:12 | 显示全部楼层
本帖最后由 zml84 于 2013-3-27 13:16 编辑

  1. ;;;指定标注对象,获取全局比例
  2. ;;;可支持 引线标注
  3. (and (setq en (car (entsel "\n请点取标注对象: ")))
  4.      (or (and (setq tmp (cdadr (assoc -3 (entget en '("ACAD")))))
  5.               (setq tmp (member '(1070 . 40) tmp))
  6.               (setq tmp (cdr (assoc 1040 tmp)))
  7.          )
  8.          (and
  9.            (setq tmp (tblsearch "DIMstyle" (cdr (assoc 3 (entget en)))))
  10.            (setq tmp (cdr (assoc 40 tmp)))
  11.          )
  12.      )
  13.      (print tmp)
  14. )
 楼主| 发表于 2013-3-27 22:38 | 显示全部楼层
zml84 发表于 2013-3-27 13:12

非常感谢,这次真的很完美了
发表于 2013-8-21 15:21 | 显示全部楼层
怎样通过组码修改全局比例
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-19 07:26 , Processed in 0.194951 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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