Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

create text file in current drawing directory

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jamesbarnett
589 Views, 3 Replies

create text file in current drawing directory

I am trying to create a text file and save it in the current drawing directory. How would I go about that?

 

(setq filepath (getvar "dwgprefix")
  (setq fl (open "PointDepth1.csv" "w"))    ;change file name and path to your specs


AutoCAD Civil 3D 2022
3 REPLIES 3
Message 2 of 4
hmsilva
in reply to: jamesbarnett


@jamesbarnett wrote:

I am trying to create a text file and save it in the current drawing directory. How would I go about that?

 

(setq filepath (getvar "dwgprefix")
  (setq fl (open "PointDepth1.csv" "w"))    ;change file name and path to your specs


Perhaps

 

(setq fl (open (strcat (getvar 'dwgprefix) "PointDepth1.csv")  "w"))
...
(close fl)

 

HTH

Henrique

EESignature

Message 3 of 4
jamesbarnett
in reply to: hmsilva

Thanks.


AutoCAD Civil 3D 2022
Message 4 of 4
hmsilva
in reply to: jamesbarnett

You're welcome, James
Glad I could help

Henriqu

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost