Converting from Lisp to VB

May 25, 2006 0 Replies

Someone can help me to convert this code in Visual Basic language... lisp it is too much complicate for me and I need to use this code (from a friend of mine) for other puorpose like area compute, big selection manage...



here is the code (sorry for my english):



---------------- (defun c:Scrivi () (setvar "cmdecho" 0)



(setq NomeFile (getfiled "Salva file di Lunghezze" "" "csv" 1)) (setq Separatore ";")



(princ "\n Seleziona le Polilinee...") (setq gruppoDist(ssget (list (cons -4 "")))) (if gruppoDist (progn (setq i 0) (setq ListaProgr nil) (repeat (sslength gruppoDist) (setq poli(ssname gruppoDist i)) (command "_area" "_o" poli) (if (assoc -3(entget poli '("SEZ"))) (setq nome(cdr(car(cdr(car(cdr(assoc -3 (entget poli '("SEZ"))))))))) (setq nome(strcat "Anonima_" (itoa i))) ) (setq ListaProgr(cons (list nome (rtos(getvar "perimeter") 2 2)) ListaProgr)) (setq i(1+ i)) ) (setq ListaProgr(vl-sort ListaProgr (function (lambda (e1 e2) (< (car e1) (car e2)))))) (setq i 0) (setq FF(open NomeFile "a")) (repeat (length ListaProgr) (write-line (strcat (nth 0 (nth i ListaProgr)) Separatore (nth 1 (nth i ListaProgr))) FF) (setq i(1+ i)) ) (close FF) (princ "\n Creato il file:")(princ NomeFile) ) ) (princ)



) ;;; (defun c:Nome () (if (not (tblsearch "appid" "SEZ"))(regapp "SEZ")) (if nome (princ (strcat "\n "))) (setq nome(getstring " Nome sezione corrente: ")) (setq pq1(append (entget (car (entsel))) (list (list -3 (list "SEZ" (cons 1000 nome)))))) (entmod pq1) (princ) ) ;;; (princ "\n ") (princ "\n Digitare SCRIVI per scrivere nel file CSV") (princ "\n Digitare NOME per dare il nome alla sezione") (princ)



--------------------------



thank's to all Soc



Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required