Author Topic: Help in Translation  (Read 1913 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
Help in Translation
« on: April 18, 2008, 02:41:12 PM »
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.

Code: [Select]
(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...  :mrgreen:

Dnereb

  • Guest
Re: Help in Translation
« Reply #1 on: May 12, 2008, 11:23:23 AM »
Well....my two cents:

To help yourself you need to help your helper.
Thing is a lot Of vba skilled people don't understand LISP (lots of silly/stupid parentheses)
So if you wrote a comment of what each lisp line doe in plain english te changes are far greater that someone can and maybe even wants to help you.


Guest

  • Guest
Re: Help in Translation
« Reply #2 on: May 12, 2008, 11:25:50 AM »
A friend of mine has a ARX translator (ie TOENGLISH) which he uses to translate individual sentences/line  of text to another language.

Don't need ARX... All you need is a web browser.

http://world.altavista.com/