redifining a block on insert

Discussion in 'AutoCAD' started by Mark Ingram, Apr 21, 2004.

  1. Mark Ingram

    Mark Ingram Guest

    With (command ".insert" (strcat
    "stamp-save=r:\\cadd\\proto\\stamp-saveR16")...) I could insert any block
    and rename it while inserting, which would also redefine if it already
    existed.

    I want "r:\\cadd\\proto\\stamp-saveR16" to come in as and redefine
    "stamp-save".

    How do I do the same here...
    (vlax-invoke-method LAYOUTNAME 'insertblock
    (vlax-3d-point '(0.0 0.0 0.0))
    (strcat "stamp-saveR16=r:\\cadd\\proto\\stamp-save") 1.0 1.0 1.0
    0.0)

    The above causes an error. Using a qualified path\\file alone works, but
    doesn't perform the rename on the fly. Can this be done with a simple tweak
    to this invoke-methode?

    Thanks,
    Mark
     
    Mark Ingram, Apr 21, 2004
    #1
  2. Mark Ingram

    Jeff Mishler Guest

    Mark,
    First check to see if the old block is in the drawing database, get the
    vla-object of the old block, then rename it to match the name of the new
    block, use the insertblock function as I described before, rename the block
    back to the original name.

    Jeff
     
    Jeff Mishler, Apr 21, 2004
    #2
  3. Mark Ingram

    Mark Ingram Guest

    I was reallly hoping you were't going to say that. :) I've got a bunch of
    different blocks (depending on what type of drawing I'm in) I use for the
    same function, so I rename/redefine on the fly. Saves a bunch of checking.
    Oh well, just trying to find the easy answer first if it's there.

    Thanks again Jeff,
    Mark
     
    Mark Ingram, Apr 21, 2004
    #3
  4. Mark Ingram

    Jeff Mishler Guest

    Heh, If you want the easy way ;-] ......

    Command: ins2tabs (use block name as it exists in the drawing)
    Command: -insert
    Enter block name or [?]: stamp-save=r:\\cadd\\proto\\stamp-saveR16
    [ESC]
    Command:

    Jeff
     
    Jeff Mishler, Apr 21, 2004
    #4
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.