sub main pat=rhino.browseforfolder("D:\COMMESSE_2007", _ "Scegli la cartella di input","Conversione Iges => 3dm") if isnull(pat) then exit sub pou=rhino.browseforfolder(pat, _ "Scegli la cartella di output","Conversione Iges => 3dm") if isnull(pou) then exit sub cup=rhino.documentpath cun=rhino.documentname if isnull(cup) or isnull(cun) then cur=null else cur=rhino.documentpath&rhino.documentname rhino.command"_save",false end if set fso=createobject("Scripting.FileSystemObject") set fld=fso.getfolder(pat) set col=fld.files cnt=0 cuk=0 rhino.enableredraw false for each fi in col rhino.command"-_new _n",false pa=fi.path ba=fso.getbasename(pa) xt=fso.getextensionname(pa) if xt="igs" or xt="iges" then fou=pou&ba&".3dm" ok=rhino.command("-_import "&pa,false) if not ok then rhino.print"File <"&pa&"> non importato" cuk=cuk+1 elseif fso.fileexists(fou) then rhino.print"File <"&fou&"> esiste" cuk=cuk+1 else ok=rhino.command("-_saveas "&fou,false) if not ok then rhino.print"File <"&fou&"> non salvato" cuk=cuk+1 else cnt=cnt+1 rhino.prompt"Conversione del file "&cstr(cnt) end if end if end if next if not isnull(cur) then rhino.command"-_open """&cur&"""",false end if rhino.enableredraw true msg="Files convertiti => "&cstr(cnt)&vbnewline& _ "Errori => "&cstr(cuk) rhino.messagebox msg end sub main