TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: baitang36 on August 11, 2021, 02:25:49 AM
-
The execution results of the following code under AutoCAD2008 and 2018 are different, and the generated file contents are different
In other words, the function princ of the higher version of autoCAD has been castrated, princ has lost the ability to write binary data
-
is the 2008 version you're testing with 64bit?
-
In other words, the function princ of the higher version of autoCAD has been castrated, princ has lost the ability to write binary data
i tested your code on acad2008 and the size of tt.txt is only 3 bytes
looks like my acad2008 is also 'castrated'
if you want to write 0 into the file then do it this way
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 98 98) (write-char c fo))
(close fo)
or use 'ADODB.Stream'
-
In other words, the function princ of the higher version of autoCAD has been castrated, princ has lost the ability to write binary data
i tested your code on acad2008 and the size of tt.txt is only 3 bytes
looks like my acad2008 is also 'castrated'
if you want to write 0 into the file then do it this way
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 98 98) (write-char c fo))
(close fo)
or use 'ADODB.Stream'
thank you very much
-
In other words, the function princ of the higher version of autoCAD has been castrated, princ has lost the ability to write binary data
i tested your code on acad2008 and the size of tt.txt is only 3 bytes
looks like my acad2008 is also 'castrated'
if you want to write 0 into the file then do it this way
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 98 98) (write-char c fo))
(close fo)
or use 'ADODB.Stream'
After a test, this method can't write 10 to the file alone. It becomes 0D 0A . one byte becomes two.
-
0A=10,Hexadecimal?
-
In other words, the function princ of the higher version of autoCAD has been castrated, princ has lost the ability to write binary data
i tested your code on acad2008 and the size of tt.txt is only 3 bytes
looks like my acad2008 is also 'castrated'
if you want to write 0 into the file then do it this way
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 98 98) (write-char c fo))
(close fo)
or use 'ADODB.Stream'
After a test, this method can't write 10 to the file alone. It becomes 0D 0A . one byte becomes two.
we can fool autocad the same way we did with 0
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 266 98) (write-char c fo))
(close fo)
-
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 266 98) (write-char c fo))
(close fo)
ok
-
Can you found other solution?
Write char by char, into file-disk, you slow-down 100% entire Win10, because
many AntivirusPrograms, contain Real-LiveWatch of HardDisk
(setq fo (open "d:/tt.txt" "w"))
(foreach c '(97 97 97 256 98 266 98) (write-char c fo))
(close fo)
ok
-
Can you found other solution?
Write char by char, into file-disk, you slow-down 100% entire Win10, because
many AntivirusPrograms, contain Real-LiveWatch of HardDisk
You mean, write many bytes at a time?.This may use the unpublished function of Acad, which can read and write binary files. The compiler in vlide is also implemented with lisp