writing info to text file with autolisp

Discussion in 'AutoCAD' started by G.H., Jul 31, 2003.

  1. G.H.

    G.H. Guest

    I'm trying to write a drawing path to a text file after using the getfiled
    function (see below) but i cant figure out how to use the write-line
    function to write the path in the text file. Any help would be great


    (defun c:setup (/ bdr info bdrok pt1)
    (setq bdr (getfiled "Select Market Border" "//Theseus/Proj/" "dwg" 8))
    (setq info (getfiled "Select Border Information" "//Theseus/Proj/" "dwg" 8))
    (setq PT1 "0,0,0")
    (setq f (open "c:/new.txt" "w"))
    (write-line (!bdr) fp)--------------this is where im having problems
    (close f)
    (do_a1)
    )
     
    G.H., Jul 31, 2003
    #1
  2. G.H.

    Vic Guest

    (write-line bdr f )
     
    Vic, Jul 31, 2003
    #2
  3. (write-line (!bdr) fp)--------------this is where im having problems

    ....replace with

    (write-line bdr f)

    The exclamation syntax is mostly used to show the value of a variable at the
    AutoCAD command line.
    The variable used for your file descriptor was "f", not "fp".
    I hope that helps.
     
    Mark McDonough, Jul 31, 2003
    #3
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.