rakes
Aerospace
- Jul 6, 2001
- 25
I am writing an AutoLISP program to read a text file and write the whole text on to AutoCAD graphics screen exactly as it would've appeared in the text file. Here is the code: (setq f1 (open f_name "r"
)
(setq str 1)
(setq block (read-line f1))
(while (/= str nil)
(setq str (read-line f1))
(if (/= str nil)
(setq block (strcat block str (chr 10)))
(princ)
)
)
(command "text" pause 10 0 block)
(close f1)
(princ)
But the text command does not print it the way it appears in the text file. Instead, it offsets each line. Can anybody tell what's wrong with my code?
(setq str 1)
(setq block (read-line f1))
(while (/= str nil)
(setq str (read-line f1))
(if (/= str nil)
(setq block (strcat block str (chr 10)))
(princ)
)
)
(command "text" pause 10 0 block)
(close f1)
(princ)
But the text command does not print it the way it appears in the text file. Instead, it offsets each line. Can anybody tell what's wrong with my code?