Author Topic: get tag info from block  (Read 1803 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
get tag info from block
« on: August 08, 2013, 12:10:27 PM »
i must not be searching for the right keywords.. :ugly:
sorry to ask this, i know this has been asked before (not by me) i just cant find it.

how can i retreive the "tag" info of an attributed block?

thanks


Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: get tag info from block
« Reply #1 on: August 08, 2013, 12:17:01 PM »
Here is a quick example:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:taginfo ( / s )
  2.     (if (setq s (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1))))
  3.         (foreach a (vlax-invoke (vlax-ename->vla-object (ssname s 0)) 'getattributes)
  4.             (print (cons (vla-get-tagstring a) (vla-get-textstring a)))
  5.         )
  6.     )
  7.     (princ)
  8. )

These functions may also be of interest.

andrew_nao

  • Guest
Re: get tag info from block
« Reply #2 on: August 08, 2013, 02:00:25 PM »
super Lee, thanks


Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: get tag info from block
« Reply #3 on: August 09, 2013, 10:38:17 AM »
You're welcome!  :-)