View Full Version : AutoCAD LT 2006 - Using Attedit in a script
dtrent_4
2006-11-10, 08:32 PM
I’m using AutoCAD 2006 LT
I am trying to change a block attribute from an ‘A’ to a ‘B’ in a script file.
-Attedit;N;N;BLOCK-NAME;-1;;A;B
Works in a macro, but
-Attedit N N BLOCK-NAME -1 A B
Hangs up in a script file. I can’t get an ENTER after the ‘A’. If I start a new line after ‘A’ it ends the command.
I am trying to change a piece of text could be an ‘A’, ‘C’, ‘D’ or ‘-‘ to a ‘B’. In a macro:
-Attedit;N;N;BLOCK-NAME;-1;;-;B
-Attedit;N;N;BLOCK-NAME;-1;;A;B
-Attedit;N;N;BLOCK-NAME;-1;;C;B
-Attedit;N;N;BLOCK-NAME;-1;;D;B
Which works OK, but now I need to do this for multiple layouts. This is why I am trying to do it in a script, so I can change the layout in a macro, then call the script, change the layout, call the script,…
My question: Using –Attedit in a script, how do I enter text at the “Enter string to change:” prompt?
Mike.Perry
2006-11-11, 06:33 AM
Hi "dtrent_4" ( Sorry, I do not know your real name )
Please note I have *moved* this thread from the AutoLISP (http://forums.augi.com/forumdisplay.php?f=91) forum to this one, as I feel this particular forum is a more appropriate place for such a topic.
Thanks, Mike
Forum Manager
Mike.Perry
2006-11-11, 06:50 AM
Hi
If I am understanding correctly, the following Script file works for me, if...
Block-Name is the name of the Block.
-1 is a valid Attribute Tag.
A is a valid Attribute Value.
A is the string to change.
B is the new string.
._-AttEdit
_N
_N
Block-Name
-1
A
A
B
Blank LineHave a good one, Mike
The Sweg
2009-09-25, 02:41 PM
I know this is an old thread, but I'm trying to accomplish the same thing but in AutoCAD LT 2009. I used your same script, but it gets hung at a point where it wants me to select an attribute. In the Text Window (which opens when the script is started), the last line says:
0 attributes selected.*Invalid*
Command:
I'm not sure if I have a system variable set wrong or what.
any help is always appreciated.
thanks!
--Derek
The Sweg
2009-09-25, 04:12 PM
ok, I remember why I'm having this issue...I cannot use this method to select blocks in Paperspace. Is there a way around it? I'm not sure if there is a system variable for this or not.
RobertB
2009-09-25, 06:00 PM
ok, I remember why I'm having this issue...I cannot use this method to select blocks in Paperspace. Is there a way around it? I'm not sure if there is a system variable for this or not.The first two options in -AttEdit, when provided with "no", ought not care where the block is inserted.
The Sweg
2009-09-29, 09:42 AM
It seems that this may be 'machine specific' as I can go through the entire command using the command line input only but cannot select any blocks in Paper Space on some machines. that's why I was wondering if some system variable controlled this.
I have 2 possible work-arounds, to either move the block temporarily into model space, do the edit and move it back to paper space, or I can use the 'c' option in the selection mode to use crossing window and type in the coordinates (which are always the same) and leave it in paper space.
thanks for the help!
JGA_o1
2011-09-23, 03:17 PM
Did this item ever get resolved?
I have two problems -
1. How do I only edit an attribute with an entry?
2. How do I edit the attribute on other layouts at the same time?
Thanks for any help anyone can provide.
Regards, JGA
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.