vernonlee Posted April 30, 2015 Share Posted April 30, 2015 I intend to use -ATTEDIT as a macro script. How to replace text attribute value (or string) in a block using -ATTEDIT regardless of its existing value? The current attribute value are all different. Example: the text attribute value is "APR 2020" or "FEB 2020 " I want the new value to be "MAY 2020". I ran this command Command: -ATTEDIT Edit attributes one at a time? [Yes/No] <Y>: N Performing global editing of attribute values. Edit only attributes visible on screen? [Yes/No] <Y>: N Drawing must be regenerated afterwards. Enter block name specification <*>: TITLE Enter attribute tag specification <*>: DATE Enter attribute value specification <*>: 1 attributes selected. Enter string to change: [b][color=blue](I cannot enter anything here as all my existing value are different)[/color][/b] Enter new string: MAY 2020 Now the value reads MAY 2020APR 2020 Any advice? Quote Link to comment Share on other sites More sharing options...
steven-g Posted April 30, 2015 Share Posted April 30, 2015 ^C^C-attedit;y;;Tag specification;;\;v;r;;; If you select the option to change the attributes one at a time it actually changes the options available for altering the attribute and it will let you replace the value, try the above macro and look at the command line history, this macro waits for you to select the block, but if you are only changing the title block there shouldn't be a need to use it on multiple attributes. However if you are running this on multiple blocks you may need to rethink things. EDIT If this is a title block then if you know the coordinates and can use those coordinates as a crossing selection this will run automatically ^C^C-attedit;y;;;;XYStartCrossingSelection;XYEnd;;v;r;;; Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 30, 2015 Share Posted April 30, 2015 If its a global change you want that all blocks have APR 2020 and you want MAY 2020 then just use FIND. Quote Link to comment Share on other sites More sharing options...
vernonlee Posted April 30, 2015 Author Share Posted April 30, 2015 ^C^C-attedit;y;;Tag specification;;\;v;r;;; If you select the option to change the attributes one at a time it actually changes the options available for altering the attribute and it will let you replace the value, try the above macro and look at the command line history, this macro waits for you to select the block, but if you are only changing the title block there shouldn't be a need to use it on multiple attributes. However if you are running this on multiple blocks you may need to rethink things. Wanted to change the value automatically without selecting/clicking any blocks. EDIT If this is a title block then if you know the coordinates and can use those coordinates as a crossing selection this will run automatically ^C^C-attedit;y;;;;XYStartCrossingSelection;XYEnd;;v;r;;; If its a global change you want that all blocks have APR 2020 and you want MAY 2020 then just use FIND. Not feasible as value is not the same & i wanted a 1 click macro script Quote Link to comment Share on other sites More sharing options...
steven-g Posted April 30, 2015 Share Posted April 30, 2015 I think those are the only options, you may be able to do it using LISP, that tends to be more flexible from what I have seen. EDIT ^C^C-attedit;n;n;;date;;jan;may;-attedit;n;n;;date;;feb;may;-attedit;n;n;;date;;mar;may; etc. unless something like this is would be an option in this case, you can even just go through and change individual letters and numers and replace them with nothing, that is unless you hit the lenght limit of a macro string Quote Link to comment Share on other sites More sharing options...
vernonlee Posted April 30, 2015 Author Share Posted April 30, 2015 I think those are the only options, you may be able to do it using LISP, that tends to be more flexible from what I have seen. EDIT ^C^C-attedit;n;n;;date;;jan;may;-attedit;n;n;;date;;feb;may;-attedit;n;n;;date;;mar;may; etc. unless something like this is would be an option in this case, you can even just go through and change individual letters and numers and replace them with nothing, that is unless you hit the lenght limit of a macro string Oh. If that is the case, then i will go the LISP way then. Anyway thanks for the effort. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 11, 2015 Share Posted May 11, 2015 use the command "GATTE" in a script. GATTE BLOCK name;blokname NAME tag;tagname new;new value YES pmxcad Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 12, 2015 Author Share Posted May 12, 2015 use the command "GATTE" in a script. GATTE BLOCK name;blokname NAME tag;tagname new;new value YES pmxcad Thanks. I tried it out but it although i type the tag name correctly, it still indicate *Invalid selection* Command: GATTE Select block or attribute [block name]: B Enter block name: TITLE Known tag names for block: 485-A105 DWG_NO SCALE DATE DWG_TITLE3 DWG_TITLE2 DWG_TITLE1 DRAWN Select attribute or type attribute name: SCALE *Invalid selection* Expects a point or 485-A105/DW Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 12, 2015 Share Posted May 12, 2015 Can you post the drawing file? Wich attribute (tag) value has to be changed/replaced. Give me the data and i wil write the script. PmxCAD Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 13, 2015 Author Share Posted May 13, 2015 Can you post the drawing file?Wich attribute (tag) value has to be changed/replaced. Give me the data and i wil write the script. PmxCAD Attached is the drawing. The tag i want to change its value is DATE. Currently is Nov 2014. To change to May 2015 I will be using it as a macro script. Thanks Drawing2.dwg Quote Link to comment Share on other sites More sharing options...
Dadgad Posted May 13, 2015 Share Posted May 13, 2015 (edited) Vernon you might want to check out this one by Lee Mac? http://www.lee-mac.com/attmodsuite.html Thanks Lee! No doubt it will be able to do it. If that one doesn't do it, then check out http://www.lee-mac.com/macatt.html Look all the way at the bottom of the description. Edited May 13, 2015 by Dadgad Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 13, 2015 Author Share Posted May 13, 2015 Vernon you might want to check out this one by Lee Mac? http://www.lee-mac.com/attmodsuite.html Thanks Lee! No doubt it will be able to do it. If that one doesn't do it, then check out http://www.lee-mac.com/macatt.html Look all the way at the bottom of the description. Thanks. for batch amending, i am using Lee's Global Attribute Editor & Extractor http://www.lee-mac.com/macatt.html Here i am trying to use a simpler method with a macro script to amend when i am within the drawing itself. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 13, 2015 Share Posted May 13, 2015 Hello again, i made something. First, i use a other gatte lisp file. load this gatte.lsp. the macro: ^C^C-GATTE;BLOCK;TITLE;NAME;DATE;May 2015;; and a script file for using it in Script pro on multiple drawings (batch) PmxCAD gatte.lsp EDIT-DATE.SCR Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 14, 2015 Author Share Posted May 14, 2015 Hello again, i made something. First, i use a other gatte lisp file. load this gatte.lsp. the macro: ^C^C-GATTE;BLOCK;TITLE;NAME;DATE;May 2015;; and a script file for using it in Script pro on multiple drawings (batch) PmxCAD Thanks bro. Was hoping for a pure macro script command but nevertheless, this method does work for me. Will test it out first. Thanks again bro. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 14, 2015 Share Posted May 14, 2015 like this? still uses the gatte.lsp ^C^C_FILEDIA;0;(load "E:/CAD/lisp/GATTE.LSP");FILEDIA;1;_GATTE;BLOCK;TITLE;NAME;DATE;May 2015;; PmxCAD Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 14, 2015 Author Share Posted May 14, 2015 like this? still uses the gatte.lsp ^C^C_FILEDIA;0;(load "E:/CAD/lisp/GATTE.LSP");FILEDIA;1;_GATTE;BLOCK;TITLE;NAME;DATE;May 2015;; PmxCAD Actually I meant without involving any LISP. is that possible? Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 14, 2015 Share Posted May 14, 2015 i don`t think so.......... PmxCAD Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 17, 2015 Author Share Posted May 17, 2015 i don`t think so.......... PmxCAD Oh. Never mind then. Thanks for the help with the lisp. Quote Link to comment Share on other sites More sharing options...
vernonlee Posted May 18, 2015 Author Share Posted May 18, 2015 Hello again, i made something. First, i use a other gatte lisp file. load this gatte.lsp. the macro: ^C^C-GATTE;BLOCK;TITLE;NAME;DATE;May 2015;; and a script file for using it in Script pro on multiple drawings (batch) PmxCAD Hi Bro, tested this & something happend & i could not continue. The part where it ask for "Block "TITLE" already exists. Redefine it?" the script is NAME. Anyway i press Y but then it ask for insertion point ommand: -GATTEUnknown command "-GATTE". Press F1 for help. Command: BLOCK Enter block name or [?]: TITLE Block "TITLE" already exists. Redefine it? [Yes/No] : NAME Yes or No, please. Redefine it? [Yes/No] : y Specify insertion base point or [Annotative]: Point or option keyword required. Quote Link to comment Share on other sites More sharing options...
pmxcad Posted May 18, 2015 Share Posted May 18, 2015 I think you didn't load the gatte.lisp Pmxcad 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.