Results 1 to 6 of 6

Thread: Batch Replace Blocks and Update With Old Attribute Values

  1. #1
    Member
    Join Date
    2006-11
    Posts
    21
    Login to Give a bone
    0

    Default Batch Replace Blocks and Update With Old Attribute Values

    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.ph...ight=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
    Attached Files Attached Files
    Last edited by brad.moon; 2007-06-29 at 07:08 PM.

  2. #2
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: Batch Replace Blocks and Update With Old Attribute Values

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

  3. #3
    Member
    Join Date
    2006-11
    Posts
    21
    Login to Give a bone
    0

    Default Re: Batch Replace Blocks and Update With Old Attribute Values

    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

  4. #4
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: Batch Replace Blocks and Update With Old Attribute Values

    Quote Originally Posted by brad.moon
    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
    Ouch, that's not a simple one. Is there a technical reason for the tags being different?

  5. #5
    Member
    Join Date
    2006-11
    Posts
    21
    Login to Give a bone
    0

    Default Re: Batch Replace Blocks and Update With Old Attribute Values

    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?

  6. #6
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: Batch Replace Blocks and Update With Old Attribute Values

    Quote Originally Posted by brad.moon
    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.

Similar Threads

  1. Select blocks based on attribute values...
    By tdickie651973 in forum AutoLISP
    Replies: 1
    Last Post: 2014-10-31, 02:22 PM
  2. Replies: 2
    Last Post: 2013-01-31, 07:56 PM
  3. Copying attribute values among blocks
    By isosa in forum AutoLISP
    Replies: 4
    Last Post: 2009-05-12, 08:40 AM
  4. Replies: 3
    Last Post: 2007-03-08, 10:06 PM
  5. Replies: 2
    Last Post: 2006-10-23, 05:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •