DuanJinHui Posted December 25, 2014 Share Posted December 25, 2014 Hello! everybody. Merry Christmas! I've done a little bit of searching for this, but have not found what I've needed. but would like to know if anyone has come up with a lisp solution. in modelspace . some attribute block, one attribute tag is "DR_DATE" , I want replace value of this tag . PS. Not replace all attribute block, only selection area . the new value I need input. Thanks! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 25, 2014 Share Posted December 25, 2014 Something like this ? (defun c:TesT (/ st ss) ;; Tharwat 25.12.2014 ;; (if (and (/= "" (setq st (getstring t "\n Specify new value :"))) (princ "\n Select Attributed blocks ...") (ssget "_:L" '((0 . "INSERT") (66 . 1))) ) (vlax-for x (setq ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (mapcar '(lambda (a) (if (eq (strcase (vla-get-tagstring a)) "DR_DATE") (vla-put-textstring a st) ) ) (vlax-invoke x 'getattributes) ) ) ) (if ss (vla-delete ss) ) (princ) )(vl-load-com) Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted December 25, 2014 Author Share Posted December 25, 2014 Something like this ? (defun c:TesT (/ st ss) ;; Tharwat 25.12.2014 ;; (if (and (/= "" (setq st (getstring t "\n Specify new value :"))) (princ "\n Select Attributed blocks ...") (ssget "_:L" '((0 . "INSERT") (66 . 1))) ) (vlax-for x (setq ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (mapcar '(lambda (a) (if (eq (strcase (vla-get-tagstring a)) "DR_DATE") (vla-put-textstring a st) ) ) (vlax-invoke x 'getattributes) ) ) ) (if ss (vla-delete ss) ) (princ) )(vl-load-com) Mr.Tharwat. It's good . very very very good! Thank you. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 25, 2014 Share Posted December 25, 2014 Mr.Tharwat. It's good . very very very good! Thank you. Happy to hear that You are most welcome . Quote Link to comment Share on other sites More sharing options...
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.