TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on April 14, 2019, 05:06:38 AM
-
I need to
PRINT a TXT file, from VISUAL LISP . . .
But
(DOS_SPOOL "c:\\LISP\\BLA-BLA-BLA.txt" (DOS_GETPRN) )
does not work !
my printer
says :
"Receiving data"
but never prints anything . . .
-
Please stop posting the same problem again and again and again.
-
Sorry !
I had a problem with your site !
When I try to send a post
it takes at least 10 minutes.
So I think that something is going wrong !
And later
i try again !
I apologize.
Please remove every thing
and leave only one instance !
sorry again !
ciao
-
Check this link
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-do-i-print-a-text-file-from-lisp/td-p/782982
Go to post 6 not tested.
-
I tried :
(STARTAPP "print" path-filename-txt)
(DOS_SPOOL path-filename-txt (DOS_GETPRN) )
(STARTAPP "print /d:\"\\\\Dbroad\\Brother MFC-6490CW Printer\"" path-filename-txt)
. . .
they don't work
. . .
and however I don't understand
the syntax of the third row
. . .
I need a simple and working solution
. . .
ciao
-
Modern printers may not be able to handle a text file.
Try using notepad.exe. Look into its command line parameters.
-
I tried :
(STARTAPP "print" path-filename-txt)
(DOS_SPOOL path-filename-txt (DOS_GETPRN) )
(STARTAPP "print /d:\"\\\\Dbroad\\Brother MFC-6490CW Printer\"" path-filename-txt)
. . .
they don't work
. . .
and however I don't understand
the syntax of the third row
. . .
I need a simple and working solution
. . .
ciao
I imagine it's not working because that is/was the address of Doug Broads printer, not yours.
-
Try:
(startapp "notepad.exe /p \"X:\\Your path\\File.txt\"")
-
"Sometimes the question is more important than the answer."
Yes. You are right !
"I imagine it's not working because that is/was
the address of Doug Broads printer, not yours."
What have I to do
to know my printer address
-> via Visual Lisp <- ?
or the printer address of a generic user ?
-
Some reading...
https://superuser.com/questions/477895/printing-from-windows-7-command-line
-
I did some work on this subject--in Cpp--at one point and it's a more difficult situation then one would expect. -i.e. if I remember properly, you can COPY a file to the COM/LPT port (COPY /B filename LPT1:) but the output depends file type you have (TXT, PS, PDF, etc.). In the end it is a big mess.
The knowing which COM/LPT port to send the information to is another big nasty problem. For my Cpp project I choose to use Redmon. Ultimately, I created redirected printer port(s) -i.e. connected a windows print driver to a redirected printer port and then used "redpr" (a better `copy to printer port method') to print my files. ...in the end, it is a bit of a mess and in the end, you'd probably be better off (save yourself a bunch of time) installing Redmon on everyone's machine (this can be automated).
-
This thread has me intrigued, what would be the advantage or printing to a TXT file?
-
,INI file
.XML file
.CSV file
General data file
etc, etc
-
"what would be the advantage or printing to a TXT file?"
I wrote my
(internal to Autocad)
NOTEPAD !
Everything works well.
But not PRINT !
-
This thread has me intrigued, what would be the advantage or printing to a TXT file?
You might be misreading this; it's about printing a TXT file to hard copy, not printing to a TXT file.
FYI, the MSXML DOM has a 'save' method to put the contents of an XML DOMDocument to file, so there's no need to use "print" like that.
-
create MTEXT, get the bounding box, plot the window
-
The true
is that
there is no real need
to print a TXT file !
Because everybody
can open a TXT, or INI or XML or LSP file
with a simple text editor
and print it.
I needed
to wrote
my Notepad
internal to Acad
. . .
and just
to make complete it
I want to be able
to print
the edited file.
. . .
-
My test shows that printing via notepad.exe works. And if you don't like the window that pops up, you can try calling notepad.exe via the Windows Scripting Host.
-
yes
this
(startapp "notepad.exe /p \"X:\\Your path\\File.txt\"")
WORKS !
. . .
But I will be happy
if it will be possible
to get the access
to the printer preferences . . .
. . .
and
without cross
notepad . . . !
-
good
to
know
that
it
works
for
you
too
!
:-D
-
thank
you
very
much
!
!
!