path spaces in script file?

Discussion in 'AutoCAD' started by Jason Wilder, May 17, 2004.

  1. Jason Wilder

    Jason Wilder Guest

    I had posted in VBA about this issue, but maybe I should look for an answer
    here in a different manner?

    Can I process drawings in a script file with spaces in the path or filename?
    I've built a routine that generates a batch plot script file, but if there
    is a space, it assumes a 'return' character and fails out.

    Any ideas?

    Thanks.
     
    Jason Wilder, May 17, 2004
    #1
  2. Jason Wilder

    ECCAD Guest

    Package the filenames with double-quote characters.
    e.g.
    open
    "Program Files\\AutoCAD 2002\\myfile"
    To 'write' the script, you can use chr(34) from Lisp.
    e.g.
    (setq filename (strcat chr(34) your_dwg chr(34)))
    (write-line outputfile filename)
     
    ECCAD, May 17, 2004
    #2
  3. Jason Wilder

    Jürg Menzi Guest

    Jason

    Wrap your path with quotation marks like:
    "c:\My Path With Spaces\My File.dwg"

    Cheers
     
    Jürg Menzi, May 17, 2004
    #3
  4. Jason Wilder

    ECCAD Guest

    If building script from VB, you might want to 'parse' the Path, pull out the "\" and replace with "/". Also, on the drawing name, ditch the .dwg. e.g.
    $dwgname = (substr dwgname 1 - (len dwgname) 4)

    Bob
     
    ECCAD, May 17, 2004
    #4
  5. Jason Wilder

    Jason Wilder Guest

    Nice! thanks Bob!

    Learn something new everyday! :D
     
    Jason Wilder, May 17, 2004
    #5
  6. Jason Wilder

    Jason Wilder Guest

    I haven't decided if I'm going to translate this over to VBA. This is a
    LISP routine utilizing DosLib right now, works well, just has that path
    issue w/ spaces.

    the "\" and replace with "/". Also, on the drawing name, ditch the .dwg.
    e.g.
     
    Jason Wilder, May 17, 2004
    #6
  7. Jason Wilder

    ECCAD Guest

    Ok,
    Cheers.
    Bob
     
    ECCAD, May 17, 2004
    #7
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.