P Raja Posted December 15, 2011 Posted December 15, 2011 how i can get the value of attribute when it is embedded into a block with multiple attributes? i am trying to get the value thru autolisp function... Quote
Tharwat Posted December 15, 2011 Posted December 15, 2011 This routine would extract all value form the selected attributed block to the command line ... (defun c:TesT (/ ss n e x) ;; Tharwat 15. Dec. 2011 ;; (while (setq ss (ssget "_+.:S" '((0 . "INSERT") (66 . 1)))) (setq n (entnext (ssname ss 0))) (while (not (eq (cdr (assoc 0 (setq e (entget n)))) "SEQEND" ) ) (if (not (eq (cdr (assoc 1 e)) nil)) (print (cdr (assoc 1 e))) ) (setq n (entnext n)) ) ) (princ) ) Quote
Lee Mac Posted December 15, 2011 Posted December 15, 2011 Here are my attribute functions with a few examples: http://lee-mac.com/attributefunctions.html Unless you are talking about nested attributed blocks? Quote
P Raja Posted December 16, 2011 Author Posted December 16, 2011 ------------------------------------------------------------------------- This is what i expected. Simple and easy program for beginners. Thank you Mr.Tharwat. ---------------------------------------------------------------- This routine would extract all value form the selected attributed block to the command line ... (defun c:TesT (/ ss n e x) ;; Tharwat 15. Dec. 2011 ;; (while (setq ss (ssget "_+.:S" '((0 . "INSERT") (66 . 1)))) (setq n (entnext (ssname ss 0))) (while (not (eq (cdr (assoc 0 (setq e (entget n)))) "SEQEND" ) ) (if (not (eq (cdr (assoc 1 e)) nil)) (print (cdr (assoc 1 e))) ) (setq n (entnext n)) ) ) (princ) ) Quote
Tharwat Posted December 16, 2011 Posted December 16, 2011 -------------------------------------------------------------------------This is what i expected. Simple and easy program for beginners. Thank you Mr.Tharwat. ---------------------------------------------------------------- Excellent , You're welcome P Raja Quote
P Raja Posted December 16, 2011 Author Posted December 16, 2011 Thank you Mr.Lee. i am beginner in Autolisp..I am not familiar with Visual lisp yet. However, i like your programms in these forums. They will be really helpful for me. Quote
Lee Mac Posted December 16, 2011 Posted December 16, 2011 You're welcome Raja FWIW, I offer some Vanilla AutoLISP solutions further down the page. 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.