Jump to content

How to replace text attribute value using -ATTEDIT regardles of existing value?


vernonlee

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 20
  • Created
  • Last Reply

Top Posters In This Topic

  • vernonlee

    10

  • pmxcad

    6

  • steven-g

    2

  • BIGAL

    1

^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;;;

Link to comment
Share on other sites

^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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

  • 2 weeks later...

use the command "GATTE" in a script.

 

GATTE

BLOCK

name;blokname

NAME

tag;tagname

new;new value

YES

 

pmxcad

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Vernon you might want to check out this one by Lee Mac?

 

http://www.lee-mac.com/attmodsuite.html

Thanks Lee! :beer:

 

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

i don`t think so..........

 

PmxCAD

 

 

 

Oh. Never mind then. Thanks for the help with the lisp.

Link to comment
Share on other sites

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: -GATTE

Unknown 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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...