A friend of mine has a ARX translator (ie TOENGLISH) which he uses to translate individual sentences/line of text to another language.
I don't know how it works but it does for him and he just as me to write a lisp for him that will take lines of text in a file and feed it to his translator.
My friend uses autocad LT with a lisp/vba addon, but for some reason the addon does like my lisp. So as an experiment i was going to see if the addon would except a VBA version of the line feeder. The lisp does work in full cad by the way so I am pretty sure there is not that many errors.
Therefore I was wondering if I could get help translating the following lisp converted to VBA. I am not that proficient in VB and will need help in translation.
(Defun Translate (LSP PAR / )
(setq CHK (findfile LSP))
(if (= CHK nil)(quit));
(if (= PAR "D")
(setq TMP (findfile "Acad.exe")
PTH (vl-filename-directory TMP)
NME (strcat PTH "Tempfile.txt")
ARG "D"
);
(setq PTH (vl-filename-directory CHK)
NME (vl-filename-base CHK)
NME (strcat PTH "\\" NME ".TR8")
ARG "E"
)
);
(setq OLD (open CHK "r")
NEW (open NME "w")
LINE T
);
(while (/= LINE nil)
(setq LINE (read-line OLD))
(if (/= LINE nil)
(progn
(setq LINE (TOENGLISH LINE ARG))
(write-line LINE NEW)
);
);
);
(close OLD)
(close NEW)
);
The lisp basically takes a text file written is another language, opens the file, translates the file and writes the translation to a temporary file which he then bring into Autocad.
The lisp is pretty basic and should be easly understood.
Any help would be appreciated...
