See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Replace an old block with a new one with the same name

  1. #11
    Member
    Join Date
    2001-08
    Posts
    10
    Login to Give a bone
    0

    Default Re: Replace an old block with a new one with the same name

    Sorry Ed, I thought I had. Here it is. Really turned out to be simple.

    Code:
    (defun C:upd-shtm-block ( / #INS)
    
    (if (tblsearch "block" "dsbdshtm")
      (command "_.insert" "dsbdshtm=" nil)
    
    )
      (command "attsync" "n" "dsbdshtm")
    
    );defun upd-shtm-block
    Mind you, this is for a very specific block.
    Last edited by Ed Jobe; 2023-09-13 at 03:02 PM. Reason: Added code tags

  2. #12
    Member
    Join Date
    2016-10
    Posts
    6
    Login to Give a bone
    0

    Default Re: Replace an old block with a new one with the same name

    Code:
    (command "_.insert" "dsbdshtm=" nil)
    This line gives me the following error:
    Code:
    "dsbdshtm.dwg": Can't find file in search path
    *Invalid*
    I'm not sure what that line is supposed to be doing, it looks like it's not doing anything.

  3. #13
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,300
    Login to Give a bone
    0

    Default Re: Replace an old block with a new one with the same name

    He stated that it was the name of a specific block. You would have to modify the code for your use. The main thing he was showing is the use of the attsync command.
    C:> ED WORKING....

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 1
    Last Post: 2018-03-18, 06:20 PM
  2. Select multiple Reference Name and set one new file path at same time
    By Wish List System in forum AutoCAD Wish List
    Replies: 9
    Last Post: 2017-10-07, 10:24 PM
  3. Replace existing block definition with new definition of the same name
    By Wish List System in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2016-10-31, 07:37 PM
  4. Identify blocks with same name and replace them with another block
    By msmith.109036 in forum AutoCAD Customization
    Replies: 2
    Last Post: 2013-11-12, 04:48 PM
  5. Replace old xref files with a set of new xref files
    By simon_coupland in forum AutoLISP
    Replies: 15
    Last Post: 2013-05-30, 05:12 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
  •