Last Save Date/Time Revit File

Hey guys,

Does anyone know, how to get the date or maybe time of the last saved revit file though dynamo?

Thanks

1 Like

@chhabrat ,

You should access the protocol…

grafik

2 Likes

oh shoot !! Thanks Mate… I’ll give it a go !! and update if I succeed…
Thanks

@chhabrat ,

i got this, but i am not shure if it is what are you looking for

import os, time

def getYYMMDD(filepath):	
    statbuf = os.stat(filepath)
    date = time.localtime((statbuf.st_mtime))
    # Debug
    #print str(date)

    # Extract out the year, month and day from the date
    year = date[0]
    month = date[1]
    day = date[2]
    # YY
    strYear = str(year)[2:]
    # MM
    if (month <=9):
        strMonth = '0' + str(month)
    else:
        strMonth = str(month)
    # DD
    if (day <=9):
        strDay = '0' + str(day)
    else:
        strDay = str(day)
    return (strYear+strMonth+strDay)

files = IN[0]    
newlist = []
for file in files:
    newlist.append(getYYMMDD(file))
OUT = newlist

you have to modify the script regarding
elements = IN[0] if isinstance(IN[0], list) else [IN[0]] #IsInstance

1 Like

Hey Mate,

It worked beautifully, I was struggling to get month right but you got it perfectly. Thank you so much :slight_smile: