vlainsertblock error

Discussion in 'AutoCAD' started by Mark Propst, Jan 30, 2004.

  1. Mark Propst

    Mark Propst Guest

    paste from vlide console

    VALIDBLOCKNAME is :
    Z:\0\DbxSourceBlock.dwg

    error message:
    Automation Error. Invalid argument bstrName in InsertBlock

    code line creating error
    (vla-insertblock
    ps;paperspace object
    (vlax-3d-point inbPt);insertion point
    ValidBlockName;string name
    1
    1
    1
    0)

    I'm not seeing what's wrong with the string name, anyone?
    tia
    Mark
     
    Mark Propst, Jan 30, 2004
    #1
  2. Mark Propst

    Jeff Mishler Guest

    This give you a clue?
    _$ (setq ValidBlockName (findfile "l:\\test.dwg"))
    "L:\\test.dwg"
    _$ (vla-insertblock
    ps;paperspace object
    (vlax-3d-point '(0.0 0.0 0.0));insertion point
    ValidBlockName;string name
    1
    1
    1
    0)
    #<VLA-OBJECT IAcadBlockReference 06e8e954>
    _$
    _$ (setq ValidBlockName "L:\TEST.DWG")
    "L:TEST.DWG"
    _$ (vla-insertblock
    ps;paperspace object
    (vlax-3d-point '(0.0 0.0 0.0));insertion point
    ValidBlockName;string name
    1
    1
    1
    0)
    ; error: Automation Error. Invalid argument bstrName in InsertBlock
    _$

    Jeff
     
    Jeff Mishler, Jan 30, 2004
    #2
  3. Looks like a backslash problem.
     
    Tony Tanzillo, Jan 30, 2004
    #3
  4. Mark Propst

    Mark Propst Guest

    Yeah, I should have shown the code creating the printout, not just the
    printout
    the entered string is "Z:\\0\\DbxSourceBlock.dwg"
    the printout at the vlide console deletes the extra backslash
    seems to be another dbx anomally
    the same exact string filename works with vlax-invoke-method 'insertBlock in
    a native dwg but not in a dbx call
    the string also passes findfile before getting to this point in the prog.
    if I use Jeff's copyobjects method with dbx it works fine
    I was just still seeing if I could find some trick to get insertblock to
    work with dbx.
    just stubborn i guess...
    :)~
     
    Mark Propst, Jan 30, 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.