satishrajdev Posted February 20, 2013 Posted February 20, 2013 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 Quote
pBe Posted February 20, 2013 Posted February 20, 2013 (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) ) Quote
satishrajdev Posted February 20, 2013 Author Posted February 20, 2013 Thankxxx a lot pBE..... Problem solved completely.... Quote
Recommended Posts
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.