I have been using this script to export my mesh to a CSV file. The problem is that every time I select a new object, the file is overwritten, so ideally when selecting a new object I need it to write a new CSV file, perhaps like this. "mesh_001.csv", "mesh_002.csv" etc. Please could someone assist.
import bpy outputFile = 'C:/My_Objects/mesh.csv' verts = [ bpy.context.object.matrix_world @ v.co for v in bpy.context.object.data.vertices ] csvLines = [ ";".join([ str(v) for v in co ]) + "\n" for co in verts ] f = open( outputFile, 'w' ) f.writelines( csvLines ) f.close()