@Jonas_Ehstein wrote:
I tried to write the following script for opening all files from one folder and saving them in an other one.
However, it's not working and I can't figure out what I'm doing wrong. Im working with Version 5.3.2Someone here that can point me to what exactly is wrong with this script?
import rhinoscriptsyntax as rs import os.path def BatchSaveAs(): folder = rs.BrowseForFolder("/Users/jehrenstein/Desktop/TEST/stp") if folder: print folder saveFolder = rs.BrowseForFolder("/Users/jehrenstein/Desktop/TEST/obj") if saveFolder: print saveFolder for filename in os.listdir(folder): if filename.endswith(".stp"): fullpath = os.path.join(folder,filename).lower() rs.EnableRedraw(False) rs.DocumentModified(False) rs.Command("_-New _None",False) rs.Command('_-Open {} _Enter'.format(fullpath)) comm="_-Export" rs.Command(comm + chr(34) + saveFolder + "/" + filename + chr(34) + ".obj" + "_Enter") rs.DocumentModified(False) rs.Command("_-New _None",False) rs.EnableRedraw(True) BatchSaveAs()
Posts: 5
Participants: 4