clh521 发表于 2013-3-26 23:33:07

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

我用这个(entget(car(entsel)))无法查到,烦请懂的帮忙下

USER2128 发表于 2013-3-27 08:12:22

(cdr (assoc 40 (tblsearch (cdr (assoc 3 (entget(car(entsel))))))))

zml84 发表于 2013-3-27 08:42:41

;;;指定标注对象,获取全局比例
(and (setq en (car (entsel)))
   (or (setq tmp
                (cdr
                  (assoc 1040
                       (cdadr (assoc -3 (entget en '("ACAD"))))
                  )
                )
       )
       (setq tmp
                (cdr
                  (assoc 40
                       (tblsearch "DIMstyle" (cdr (assoc 3 (entget en))))
                  )
                )
       )
   )
   (print tmp)
)

clh521 发表于 2013-3-27 10:15:32

USER2128 发表于 2013-3-27 08:12 static/image/common/back.gif
(cdr (assoc 40 (tblsearch (cdr (assoc 3 (entget(car(entsel))))))))

谢谢,你这一句很简洁,但运行时错误,出现:
错误: 参数太少

clh521 发表于 2013-3-27 10:17:14

本帖最后由 clh521 于 2013-3-27 10:20 编辑

zml84 发表于 2013-3-27 08:42 http://bbs.mjtd.com/static/image/common/back.gif


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

但是对于引线标注就不正确了

zml84 发表于 2013-3-27 13:12:29

本帖最后由 zml84 于 2013-3-27 13:16 编辑

;;;指定标注对象,获取全局比例
;;;可支持 引线标注
(and (setq en (car (entsel "\n请点取标注对象: ")))
   (or (and (setq tmp (cdadr (assoc -3 (entget en '("ACAD")))))
            (setq tmp (member '(1070 . 40) tmp))
            (setq tmp (cdr (assoc 1040 tmp)))
         )
         (and
         (setq tmp (tblsearch "DIMstyle" (cdr (assoc 3 (entget en)))))
         (setq tmp (cdr (assoc 40 tmp)))
         )
   )
   (print tmp)
)

clh521 发表于 2013-3-27 22:38:44

zml84 发表于 2013-3-27 13:12 static/image/common/back.gif


非常感谢,这次真的很完美了

jyzas 发表于 2013-8-21 15:21:44

怎样通过组码修改全局比例
页: [1]
查看完整版本: 如何获得某个标注对象的全局比例?