I was thinking how could be possible to get into revit the “date and time” of the last time that a certain dynamo script was runned?
I think that it could be really cool for project management to have the possibility to have an schedule into revit with the following information: all the dynamo scripts used in the project, date and time of the last run of each script and the name of the user who executed these last runs.
That is a cool idea. I think you could accomplish it pretty easily with a Detail Component. Each Detail component would have a parameter for Date/Time, UserName, And DynamoScript Name. For each Dynamo Script you want to track, you create a Detail Component in your DynamoTracking Drafting View and type in the name of the DynamoScript you wish to track. Your Dynamo Script would then have a section where you have set a String as the official Script Name, and you would search for the Detail Component that has that same Script Name entered. Then you would write the User Name and Date/Time into that element. Provided you have used Shared parameters, you should be able to schedule all of the most recent runs.
Another idea would be to have your Dynamo Script create a new Detail component in the view of your choice each time the script is run, then you could have a full history of the runs inside of Revit.
Thanks a lot for your answer and sorry for my delay reply. You were right it was pretty easy to make work this idea.
The approach that I followed was to create first a detail item family with 3 generic annotation famalies nested on it. These 3 nested families where associated to the 3 shared family parameters that I wanted to control with the run of each dynamo script : script name, user name and date time of the last run.
After this step I created the dynamo script by selecting the detail item family that I’ve just created it and pulling from dynamo "the script name"by using an string, "user name"by using a python script that you can find in the forum (http://dynamobim.org/forums/topic/get-the-revit-user-name/) and date/time of the run by using the node “DateTime.Now”
Finally I created and schedule showing these 3 parameters from the detail item family placed in the drafting view for having this information documented
Hey there,
I know this topic is a couple of years old, but I have a very similar use case. I want to create a sign in Revit that shows the last time the script was executed.
The problem is that the DateTime.Now node does not update – it always shows the same time, even when I run the script again.
Does anyone have an idea how I can make the node return the current time each time I execute the script?
I can’t remember the exact details, but I did something like this many years ago with the excellent Slingshot! package and a very lightweight sqlite database.
I don’t know if Slingshot! still works- I think Nathan has abandoned Dynamo & works exclusively with Grasshopper..?
Anyway, I had a very basic sqlite table with a column with a default value of now() and maybe another column with an auto-incrementing integer ID. So each time Dynamo ran the graph, it created a new ID & a timestamp. Sounds more complicated than it was.
You can also use a custom function in design script to trigger the Datetime.Now method as long as the code block has an input to trigger it - should you put it near the end of your graph that will likely always happen. Something like [Datetime.Now(),trigger][0]; should do the trick (though it may be DateTime.Now() - can’t test at the moment).
arhhh thanks @jacob.small , didnt know the trick with tune up…nice stuff for my small brain yeah guess your other method could work as well, i have for long time ago made some similar…and if i remember right it works as well…cheers buddy
Wow thank you guys for the quick help. I guess my brain is also too small to understand the solution (or my english is too bad lol) but Dynamo gives me the following errors… Is my input wrong?