Script to incrementally save a file


#1

G’day Everyone,

Does anyone have a script for saving a file with date and/or time appended to the front? Similar to incremental save functionality it will create a new file each time and/or each day it is run.

regards,
Nick.


#2

@Ncik,

You can try the python script below, roughly tested on Windows only.

SaveFileWithDateTime.py (2.3 KB)

Some rules to note:

  • if the file has not been saved, it prompts to save, suggesting a date_time prefix
  • if the file has been saved, it prompts to safe if there is no date_time prefix
  • if the file has been saved with a date_time prefix of the same time, it saves over it
  • if the file has been saved with a date_time prefix of different time, in saves with new date_time

The date_time and filename format looks like below, both underscore seperators are required:

20160220_0200_YourFileName.3dm

which equals:

YearMonthDay_HourMinute_YourFileName.3dm

Using this format, files should appear ordered in your explorer window. Note that if a file is saved in the same minute, a backup file is created if the option is enabled under:

Rhino Options / Files / Save / Create backup (*.3DMBAK) files when saving

c.


#3

Good work, thanks @clement.


#4

@clement

Hi clement,

If I want to re-export to file name with likes: object01,object02,object03,… by once use the python.

Regards,
Alen