file not found error

Discussion in 'AutoCAD' started by elise_moss, Mar 11, 2005.

  1. elise_moss

    elise_moss Guest

    I have the following line of code:

    (setq dwgFile "V:\\Marketing\\Work Samples\\Sample AutoCAD Drawings\\SAMPLE-INDEX-A.1.dwg" )


    I then go:

    (vl-load-com)
    (setq acadDoc (vlax-get-property (vlax-get-acad-object) 'Documents))
    (vlax-invoke-method acadDoc 'Open dwgFile))

    ;;;
    this gives me a file not found error.

    If I use:
    (setq dwgFile (getfiled "Select dwg file containing package list" "*" "dwg" 8))

    ; which makes the user manually locate the file on the network, then it will load and open properly.

    Obviously, I do not want to have to make the user manually look for the file...so, what am I doing wrong when I set the variable? I have tried every possibility of \ ,\\, /, // that I can think of.

    Thanks,

    Elise Moss
    www.mossdesigns.com
     
    elise_moss, Mar 11, 2005
    #1
  2. elise_moss

    Jeff Mishler Guest

    Check your path again. I just tried it using the same file name in a
    different path and it worked fine.....

    (setq dwgFile "C:\\Base Maps\\Jeffs Test
    Files\\junk\\SAMPLE-INDEX-A.1.dwg" )

    (setq acadDoc (vlax-get-property (vlax-get-acad-object) 'Documents))
    (vlax-invoke-method acadDoc 'Open dwgFile)
     
    Jeff Mishler, Mar 11, 2005
    #2
  3. elise_moss

    Bill DeShawn Guest

    You can add the path to your Support File Search Path in Options;Files.
    Then:
    (setq dwgFile (findfile "SAMPLE-INDEX-A.1.dwg"))

    --
    Bill DeShawn

    http://my.sterling.net~bdeshawn

    Drawings\\SAMPLE-INDEX-A.1.dwg" )
    file...so, what am I doing wrong when I set the variable? I have tried
    every possibility of \ ,\\, /, // that I can think of.
     
    Bill DeShawn, Mar 11, 2005
    #3
  4. elise_moss

    elise_moss Guest

    Is there a way to programmatically add the path to the support files list if the file is not found?

    The reason I ask is that we will have mulitple users trying to locate these files and they may or may not have the paths set up in their support files options.
     
    elise_moss, Mar 11, 2005
    #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.