Hi everyone, I was trawling last week looking for ideas to quickly change title block attribute values, when I came across this augi thread:
http://forums.augi.com/showthread.php?64985-Using-lisp-to-Edit-Attributes-in-a-Title-BlockI have a bunch of drawings in a current job that all need to have an attribute altered. I wasn't fussed about a program that looks at a folders drawings and by some sorcery makes all the title blocks change; rather some nifty lisp that will change an attribute in whatever drawing I have open.
I had an idea for automating the attedit dialog and it turns out I wasn't far off with my reasoning.
In fact rkmcswain's code is just what I wanted:
(command "._attedit" "_N" "_N" "Sheet Details-DSA" "WHAT_IS_THE_CURRENT_ISSUE" "*" "#" "1")
However I have encountered an issue I'm hoping the forum can set me right on.
Some of my attribute tags read as follows:
DRAWING_#
SCALE
as examples.
Now the code works just fine for replacing the 'scale' value, but only when I remove the dynamic visibility states from the block.
However it repeatedly prompts an error when looking at the 'drawing_#' tag and value, no matter if the visibility states are removed or not.
Command: (command "._attedit" "_N" "_N" "A1 FRAME BLOCK"
(_> "DRAWING_#" "*" "#" "12345"
(_> )
._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 <*>: A1 FRAME BLOCK
Enter attribute tag specification <*>: DRAWING_#
Enter attribute value specification <*>: *
0 attributes selected.*Invalid*
; error: Function cancelled
The above is typical of the kind of error I'm encountering.
Is this because of the way my attribute tags are named (using special characters), or like the problem with the 'scale' alteration, is this something related to the block having a dynamic visibility state (this is something I don't want to remove).
I think autocad creates 'random' names for dynamic block states (I can't think of a better way to describe it), so I'm thinking that this will stop the code from identifying the attributes some how.
Much obliged for any input on this.