G’day everyone,
I developed a script to export attributes to a CSV file. All worked well.
Copy and paste the functional part to a Command, save, close rhino, open rhino, run command as usual and this error pops up.
import rhinoscript.userinterface
import rhinoscript.geometry
import rhinoscriptsyntax as rs
__commandname__ = "naExportAttributes"
# RunCommand is the called when the user enters the command name in Rhino.
# The command name is defined by the filname minus "_cmd.py"
def RunCommand( is_interactive ):
# Export all surface data as CSV
# create a filename variable
filename = rs.SaveFileName("Save CSV file","*.csv||", None, "test", "csv")
#open the file for writing
file = open(filename, 'w')
#create and write a header for the CSV file
header = "Part Name,Area,Thickness,Throw,LCG,TCG,VCG\n"
file.write(header)
blah blah blah
file.close()
Any thoughts? I’m stumped.
regards,
Nick