redefine block thru scripting

Discussion in 'AutoCAD' started by mkh, Jun 29, 2004.

  1. mkh

    mkh Guest

    I have a block in some drawings (rel. 2004) that I need to redefine. I can't
    seem to figure out how to do this thru a script. Can anyone tell me how to
    do this. I need to insert the block RR= to redefine, but i cant get this to
    work.

    Any help will be greatly appreciated.

    Mike
     
    mkh, Jun 29, 2004
    #1
  2. mkh

    EarlM Guest

    Mike,
    Here is part of a script file I wrote a while ago to redefine blocks in a
    drawing.
    One line is an example how to handle block names with a space in them, the
    other is for names with out any spaces.

    ;Update Blocks.scr
    ;
    -Insert
    "BUILDING CORNER=C:\EMorrill\Projects\Backup\LRWD\Blocks\BUILDING CORNER"
    0,0
    1
    1
    0
    ;
    ;
    -Insert
    CROSS=C:\EMorrill\Projects\Backup\LRWD\Blocks\CROSS
    0,0
    1
    1
    0
    ;
    ;

    Try it and see if this does the trick.
    Earl
     
    EarlM, Jun 29, 2004
    #2
  3. mkh

    ECCAD Guest

    You might want to change all the "\" char's to "/" instead.
    Bob
     
    ECCAD, Jun 29, 2004
    #3
  4. mkh

    mkh Guest

    thanks.....
    I'll check it out.
    MKH
     
    mkh, Jun 29, 2004
    #4
  5. If you want to redefine a known particular block in a bunch of drawings,
    EarlM's approach could be good. If you want to be able to redefine any
    block in any drawing, here's my macro-command/lisp variety that prompts for
    a drawing name:

    [RedefIns]*^C^C^P(setq rgnmd (getvar "REGENMODE")) +
    (setq redef (getstring "NAME OF INSERTED DWG TO REDEFINE: ")) \+
    REGENAUTO OFF -INSERT (strcat redef "=") ^C^P+
    SETVAR REGENMODE !rgnmd

    It requires the drawing in question to be on the search path or in the same
    folder as the drawing you're in. It's built to repeat for as many as you
    want, so it turns off Regenmode in the meantime, and you Regen after you've
    redefined all you need to.

    I don't know whether you could do it this way (with filename prompt) in a
    Script.

    Kent Cooper, AIA
     
    Kent Cooper, AIA, Jun 30, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.