Include quotes when writing to script file

Discussion in 'AutoCAD' started by iwafb, Nov 18, 2004.

  1. iwafb

    iwafb Guest

    Hi all,

    I have a problem trying to open a drawing from a script file. Basically, the directory has spaces in the name and the script doesn't recognise it. I have researched the discussion groups and found that I need to include the path and file name in quotes.

    My problem is that I do not know how to write this path out from a lisp file including quotes, for example:

    ;set drawing name and path as a string
    (setq DWGN (strcat (getvar "dwgprefix"
    (getvar "dwgname")))

    ;open script file and write line
    (setq SCR_FILE "c:\\dwg\\rev.scr")
    (setq FN (open SCR_FILE "a"))
    (write-line "open" FN)
    (write-line DWGN FN)
    (close FN)


    Using this method, the path is written to file without the quotes. How can I include them as well?

    Thanks in advance
    Dart
     
    iwafb, Nov 18, 2004
    #1
  2. iwafb

    Jim Claypool Guest

    (write-line (strcat "open \"" dwgn "\"") fn)
     
    Jim Claypool, Nov 18, 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.