Change Date Format in Schedule

I have a schedule in Revit with an “End of Life” column populated with dates. The formatting of the dates are yyyy-m for example January 2019 would be 2019-1. I want it to say 2019-01. So if the the month number is less than 10 I want to pad it with a 0. Any ideas?

Have you started with the graph? This may help:

That’s what I would like to do, but my situation is a bit different. This is what I have so far

After looking into it a bit more. The column in the schedule is populated by a shared parameter also. If that provides any help

It looks like you’ll have to split up the month, day, and year first. Then you can pad the month and join them back together.

I believe I can get it, but how do I then make Revit edit the formatting? Right now all the script is doing is editing the info in Dynamo. It’s not putting it back into Revit.

I assume that you shared parameter ‘date’ is a ‘text’ parameter?

If so, alter the data, and use setparameter again.

OOTB nodes (and no python, fun fun):
This checks day and month (2 characters) and years (4 characters).

1 Like

Your script worked great! Except I’m having trouble getting the shared parameter set back into Revit. The SetParameterByName node is saying no parameter found by that name. Is it because it’s a shared parameter?

is it a type parameter or an instance parameter?

If it’s a type: you’ll have to get the type of that instance element first.

They are instance parameters

Are they in a group?

They are in a parameter group within the shared parameter file if that’s what you mean.

Share a screenshot of your graph so we can see what’s going on.

The element input needs to be the elements you’re setting the values for.

It’s technically the same parameter, but I’ve tried hooking it up to the schedule data node as well and it doesn’t work

A schedule is just a table of element properties. You have to know which values go with which elements in order to write the values back to those elements.

1 Like