InsertBlock Method Inconsistent with Help

Discussion in 'AutoCAD' started by Nick_Merchant, Oct 27, 2004.

  1. This method only seems to work (and works great) if the block is already defined in the drawing. However the help menu says:

    "...

    Name

    String; input-only
    The name of the AutoCAD drawing file or the name of the block to insert. If it is a file name, include any path information necessary for AutoCAD to find the file and the .dwg extension.

    ..."

    If I specify the filename for a block that's not in the drawing I get the following error:

    "...Automation Error. Key not found..."

    However, I if use the VLisp function:

    " ( vl-file-systime "MyFilename" ) "

    then the expected file information is returned, meaning the file exists in the specified path.

    " (2004 10 3 27 5 13 28 638) "

    Yes, I am specifying the path, I am using forward slashes to delimit the filename fields, and yes I am appending the file name with ".dwg".

    What am I doing wrong?
     
    Nick_Merchant, Oct 27, 2004
    #1
  2. I figured it out.

    When using ActiveX, the forward slash cannot be included in filename designations.

    I substituted "\\" for "/" and it worked as expected.

    Live and learn...
     
    Nick_Merchant, Oct 27, 2004
    #2
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.