Jump to content

Multiple Attribute Export


satishrajdev

Recommended Posts

hi all,

I am using LEE MAC's code for getting attribute value which is as follows :-

(defun LM:vl-GetAttributeValue ( block tag )
   (setq tag (strcase tag))
   (vl-some
       (function
           (lambda ( attrib )
               (if (eq tag (strcase (vla-get-Tagstring attrib)))
                   (vla-get-TextString attrib)
               )
           )
       )
       (vlax-invoke block 'GetAttributes)
   )
)

 

(defun c:test ( / ss )  
   (if (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1))))
       (princ
           (LM:vl-GetAttributeValue
               (vlax-ename->vla-object (ssname ss 0))
               (getstring "\nSpecify Tag String: ")
           )
       )
   )
   (princ)
)
(vl-load-com)

 

But my prob is, I want to select multiple blocks at the time, please provide any solution for this

 

Thank you

Link to comment
Share on other sites

(defun c:test ( / ss tag i)  
   (if
     (and (setq tag (getstring "\nSpecify Tag String: "))
          (not (eq "" tag))
     	   (setq ss (ssget  '((0 . "INSERT") (66 . 1))))
     )
       (repeat (setq i (sslength ss))
           (print (LM:vl-GetAttributeValue
               (vlax-ename->vla-object (ssname ss (setq i (1- i)))) tag
               
           )
                  )
       ) 
   )
   (princ)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...