bono05 Posted March 31, 2015 Posted March 31, 2015 Hi Lee Mac, I'm using autocad 2010 and if i change a tag...and select a another plan to save it, wel he's open... doing something and then save and close....but nothing change?! I don't know why. Quote
bono05 Posted March 31, 2015 Author Posted March 31, 2015 Ok i'll tried ;-) Lisp are not working for me and i don't know why? So first step: -open a plan and type batte -then select a block -Edit item and change tag name -then next -choose another plan and then "Run" and finally i always have the old tag name?! Can you help me? Finally i need to change +/- 40 "tags" blocks (actually with different tags name). And i would like to change all those block to have same Tags name. It's possible? Quote
bono05 Posted April 1, 2015 Author Posted April 1, 2015 Ho damned!! It's normal that not working with me Do you have any idea to change tags (to same tag) from all blocks in a drawing? Actually i have many blocks with differents tag's name, and i need to have all blocks with same tag name ("TYPE"). Quote
Tharwat Posted April 1, 2015 Posted April 1, 2015 Ho damned!! It's normal that not working with me Do you have any idea to change tags (to same tag) from all blocks in a drawing? Actually i have many blocks with differents tag's name, and i need to have all blocks with same tag name ("TYPE"). Hi bono Here is a program that I have wrote a long time ago and this is the first I am posting it in public , so to cover your request about changing tags , just choose from the Modifications Options -> Tags then the edit box for the new tag should be activated . Try it and let me know . Presentation of the program . Attm.rar Quote
bono05 Posted April 1, 2015 Author Posted April 1, 2015 Thank very much Tharwat! Just one thing By 'Attributed Block names there are of "all blocks" or "by selected block". Is there a possibility to select blocks in a list? for sample if i have 60 blocks and i need only to change 40? Quote
Tharwat Posted April 1, 2015 Posted April 1, 2015 Thank very much Tharwat!Just one thing By 'Attributed Block names there are of "all blocks" or "by selected block". Is there a possibility to select blocks in a list? for sample if i have 60 blocks and i need only to change 40? You're not in need of more than these lines of codes try it and let me know . (defun c:test (/ ss tag ) ;; Tharwat 1st.Apr.2015 ;; (if (and (setq tag (getstring t "\n Specify new tag string :")) (princ (strcat "\n Select Attributed blocks to change to new TAG name < " tag " > .")) (setq ss (ssget "_:L" '((0 . "INSERT")(66 . 1)))) ) ((lambda (i / sn ) (while (setq sn (ssname ss (setq i (1+ i)))) (mapcar '(lambda (g) (if (vlax-write-enabled-p g)(vla-put-tagstring g tag))) (vlax-invoke (vlax-ename->vla-object sn) 'getattributes) ) ) ) -1 ) ) (princ) )(vl-load-com) Quote
bono05 Posted April 1, 2015 Author Posted April 1, 2015 Problem now is that i have 2 tags per blocks....and only one need to be replaced. Quote
Tharwat Posted April 1, 2015 Posted April 1, 2015 Problem now is that i have 2 tags per blocks....and only one need to be replaced. What is the name of that tag that you want to replace with a new one ? Quote
bono05 Posted April 1, 2015 Author Posted April 1, 2015 that's the problem...each block has a different tag now. SO the tag that i will change is always different. In fact Attm.lisp is a great tool because you see option "tag string"....but for me i need to select a number of blocks and not all blocks. Quote
bono05 Posted April 1, 2015 Author Posted April 1, 2015 I will give you a sample. Actually it's like this: Block name: Type A Tag: A Value: A (or A/S) Tag: Circuit Value: (empty) Block name: Type B Tag: B Value: B (or B/S) Tag: Circuit Value: (empty) Block name: Type K Tag: K Value: K (or K/S) Tag: Circuit Value: (empty) Ect........ Tag "circuit" need to stay like this...only Tag A,B,K.... need to change to TYPE. But i have also another blocks totally with others tags and those don't need to be changed. Quote
bono05 Posted April 3, 2015 Author Posted April 3, 2015 Hi bono Here is a program that I have wrote a long time ago and this is the first I am posting it in public , so to cover your request about changing tags , just choose from the Modifications Options -> Tags then the edit box for the new tag should be activated . Try it and let me know . Presentation of the program . [ATTACH=CONFIG]53558[/ATTACH] Hi Tharwat, Finally i found a solution to use this... I'll isolate all blocks i need to change tags name and than copy/paste to new dwg and after "Attm" copy/paste back to original dwg! So thank very much for your routine! Quote
Tharwat Posted April 3, 2015 Posted April 3, 2015 Hi Tharwat, Finally i found a solution to use this... I'll isolate all blocks i need to change tags name and than copy/paste to new dwg and after "Attm" copy/paste back to original dwg! So thank very much for your routine! You're welcome and I am happy that you found my program helpful and useful . Good luck . Quote
bono05 Posted March 9, 2016 Author Posted March 9, 2016 Hello, I'm tried to execute attm.vlx but i receive this: ** Error: bad argument type for compare: "50" 50 ** I don't understand the problem!? Quote
Tharwat Posted March 9, 2016 Posted March 9, 2016 Hi, Can you explain the steps you did which happen to throw that error ? Quote
SLW210 Posted March 9, 2016 Posted March 9, 2016 I moved your posts to a new thread. Change Attribute Tags Quote
bono05 Posted March 9, 2016 Author Posted March 9, 2016 Hi,Can you explain the steps you did which happen to throw that error ? Hi Tharwat, Just type attm...and i receive this error! Before i've never had that... Command: attm ** Error: bad argument type for compare: "50" 50 ** Command: Quote
bono05 Posted March 9, 2016 Author Posted March 9, 2016 Try it with another drawing and blocks. Already done... I'll start my pc tomorrow morning and tried again! Now i'm going home... ;-) Quote
Tharwat Posted March 10, 2016 Posted March 10, 2016 Not a problem; Be sure to delete the program attm.vlx from your computer or replace it with the following updated one. Attm.rar 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.