DuanJinHui Posted May 21, 2015 Share Posted May 21, 2015 Dear.All Before, I had requested a thread at here: http://www.cadtutor.net/forum/showthread.php?90216-Replace-the-attribute-value&highlight=DuanJinHui (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 helped me. But this can only replace one attribute value (TAG=“DR_DATE”) If I want replace another attribute value . I need modify the source code. I have a idea. use dialog to choose Tag and modify attribute. Here is DCL code . I don't know coding this . I need help ! I really appreciate it. BRA:dialog { label = "Batch Replace Attribute" ; :boxed_row { label = "TAG" ; :column { :radio_button { key = "K1" ; label = "TAG1" ; } :radio_button { key = "K2" ; label = "TAG2" ; } :radio_button { key = "K3" ; label = "TAG3" ; } :radio_button { key = "K4" ; label = "TAG4" ; } :radio_button { key = "K5" ; label = "TAG5" ; } :radio_button { key = "K6" ; label = "TAG6" ; } :radio_button { key = "K7" ; label = "TAG7" ; } :radio_button { key = "K8" ; label = "TAG8" ; } } } :spacer {} :edit_box { key = "Val" ; label = "Value:" ; } :spacer {} :row { ok_cancel; } } Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 21, 2015 Share Posted May 21, 2015 Have you seen this program by me ? Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted May 21, 2015 Author Share Posted May 21, 2015 Have you seen this program by me ? Mr Tharwat, That is a great tool, I love it . Thanks very much. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 21, 2015 Share Posted May 21, 2015 Mr Tharwat, That is a great tool, I love it . Thanks very much. Happy that you like it and 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.