Code Red > AutoLISP (Vanilla / Visual)

output a .txt file

(1/6) > >>

dubb:
i know this is possible. i want to output a .txt file with lisp. in that file it should contain text that i type in when the lisp file prompts me to. in other words i run a routine then the routine prompts me to write something in and it repeats this until i have provided all the information. then it writes a .txt file. the purpose for this is my idea of user interaction when making a plot. before the plot command executes this routine should pop-up and ask certain questions and after the questions are answered (by input from user) then it writes the text file. can somebody guide to the right direction?

Mark:
To open a file for writing;

--- Code: ---(setq file_open (open "c:\\name.txt" "w"))
--- End code ---

then you want to write to it using;

--- Code: ---(write-line "some string" file_open)
--- End code ---

when you're done make sure you close the file

--- Code: ---(close file_open)
--- End code ---


that's a start anyway.

dubb:
thanks, ill be be back later with a routine..hopefully......

Mark:
I'll be waiting... :)

dubb:
UM...HOW do i make it so another lisp routine runs after i plot. in other words after i plot a drawing then this new command runs directly after that. and how do i get strings of information on the plotter's page setups? what im looking for is to get the size of the sheet of the current drawing that was sent to the plotter.

Navigation

[0] Message Index

[#] Next page

Go to full version