Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Redefine a Block Inserting it with a Script

  1. #1
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Redefine a Block Inserting it with a Script

    I want to redefine a block in several drawings, so I would like to do it with a script.

    I have tried the -insert command, with the name of the block as:

    "F:\Corporate\2002 Projects\Smart Corner Office\Dwgs\Details\jamb.dwg"

    But this doesnt prompt for re-definition. Is there a way to do this in the command line?

    Thanks,

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    -insert
    Jamb=F:\Corporate\2002 Projects\Smart Corner Office\Dwgs\Details\Jamb
    0,0,0
    1
    1
    0
    (entdel (entlast))

  3. #3
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    Thanks Robert, but how do I use it? I made a script with your code, and I get:

    Invalid block name.

    I am using Autocad 2004 if that has something to do with it.

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    Make sure you don't have any trailing spaces on the commands.

    Attached is a more comlete version of the script. Of course, you need to edit the block/filename.
    Attached Files Attached Files

  5. #5
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    I droped this for a time. I re-took the project, and I got the script working now. For directory or file names with blank spaces, you have to use quotation marks like this:

    AttDia 0
    AttReq 0
    -insert
    "E-DOOR-36X80=F:\Urban\2003 Projects\03865 One Library Circle\03865.03\Dwgs\Blocks\Windows\E-DOOR-36X80"
    0,0,0
    1
    1
    0
    (entdel (entlast))
    AttReq 1
    AttDia 1


    Thank you Robert.

  6. #6
    Member
    Join Date
    2004-10
    Posts
    6
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    I am trying to do this also. I am testing the command first in the drawings before creating a script. When I go through the commands though it says the block refereneces itself, regenerated the layout and then says *Invalid*. Does the file name at the end of the path have to be the same name as the block name i am trying to redefine? Right now they are different; the block is called ASCGtb-Arch F 30x42 and the file name is 999999-A-101.dwg. I changed the block in the 999999-A-101 file and am trying to redefine it in a 999999-A-102 file. I would like to see this work before I create a script for it.

    Thanks,

  7. #7
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    Look in the block file - does it contain a block of the same name?
    If so, explode the block (if necessary) and Purge the block reference from the file.

  8. #8
    100 Club
    Join Date
    2006-01
    Location
    Macau
    Posts
    117
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    maybe asking a wrong question.
    Last edited by Cheuk Ling; 2008-08-25 at 12:22 AM.

  9. #9
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    I used

    UCS WORLD
    ZOOM EXTENTS
    ATTDIA 0
    ATTREQ 0
    FILEDIA 0
    INSERT
    N=P:\Dwgs\LIBRARY\BLOCKS\~Structure\Stair_Plans\Stair_1_Typ
    0,0 1 1 0
    ATTDIA 1
    ATTREQ 1
    FILEDIA 1
    ERASE LAST
    QSAVE

    not really sure what the attdia and attreq do as per the above but it seems to help

  10. #10
    Login to Give a bone
    0

    Default Re: Redefine a Block Inserting it with a Script

    Actually sorry its

    UCS WORLD
    ZOOM EXTENTS
    ATTDIA 0
    ATTREQ 0
    FILEDIA 0
    INSERT
    Stair_1_Typ=P:\Dwgs\LIBRARY\BLOCKS\~Structure\Stair_Plans\Stair_1_Typ.dwg
    0,0 1 1 0
    ATTDIA 1
    ATTREQ 1
    FILEDIA 1
    ERASE LAST
    QSAVE

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 2014-06-30, 06:58 PM
  2. Redefine Contained Blocks when Inserting a DWG file
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 5
    Last Post: 2013-03-20, 08:46 PM
  3. Multiple block insertion with a script to redefine existing blocks?
    By drafterjohn in forum AutoCAD Customization
    Replies: 5
    Last Post: 2009-08-10, 01:52 PM
  4. Redefine Open - automatically run a script upon opening a drawing
    By Mamma Jamma in forum AutoCAD Customization
    Replies: 9
    Last Post: 2005-12-21, 07:33 PM
  5. Redefine block script
    By tuomo.jarvinen in forum AutoLISP
    Replies: 4
    Last Post: 2005-01-11, 04:19 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
  •