PDA

View Full Version : Batch Replace Blocks and Update With Old Attribute Values


brad.moon
2007-06-29, 08:57 PM
Hi,

I have many files containing two title blocks in each, that need to be replaced with new versions of the same blocks and have the attribute values of the new versions replaced with the attribute values from the old.

I have attempted this using lisp (it doesn't work) and have likely made fundamental errors in the application of lists (see attached). My feeling is vlisp might work best, especially when incorporating windows explorer to select all the folders with drawings required for batch processing; or would that be VBA. I have reviewed some of the threads on attributes such as:
http://forums.augi.com/showthread.php?t=58483&highlight=attribute were kennet.sjoberg posted a nice bit of vlisp code, but haven't been able to put all the pieces together.

Any thoughts?

Thanks,

Brad

Avatart
2007-07-02, 10:36 AM
I had to do exactly the same thing the other day, I solved it using the Script below. The Cust_A1v is being replaced by the Cust_A0v:

ATTDIA
0
ATTREQ
0
(if (/= nil (setq smalltblock (tblsearch "BLOCK" "Cust_A1v"))) (vl-cmdf "-rename" "Block" "Cust_A1v" "Cust_A0v"))
-INSERT
"cust_a0v=G:/Jobs/39206 BSkyB/Settings/Borders/cust_a0v"
0,0,0

Zoom
Extents
ERASE
L
ATTSYNC
name
cust_a0v
(setq smalltblock nil)

brad.moon
2007-07-03, 07:40 AM
Thanks Carl. The simple solution is the best in most cases, isn't it.

I ran the script on some test files and it works great. I will have to tweak the script for the one attribute that has a different tag between the blocks (if possible). It happens to be the drawing number.

Brad

Avatart
2007-07-03, 10:02 AM
I will have to tweak the script for the one attribute that has a different tag between the blocks (if possible). It happens to be the drawing number.

BradOuch, that's not a simple one. Is there a technical reason for the tags being different?

brad.moon
2007-07-03, 04:46 PM
This is a client title block and border so I don't know what the technical reason would've been. It may have been divine intervention suggesting that the tag for their drawing number should be something more descriptive than "XXXXX-X-XXX-XXX".

I bumped into a colleague late last week that thought he may have a solution for this. Would you be interested in it if it works?

Avatart
2007-07-03, 04:52 PM
This is a client title block and border so I don't know what the technical reason would've been. It may have been divine intervention suggesting that the tag for their drawing number should be something more descriptive than "XXXXX-X-XXX-XXX".

I bumped into a colleague late last week that thought he may have a solution for this. Would you be interested in it if it works?I hate it when people tag like that.

I would be very interested to hear a solution to that, I have never managed to work it out.