I’m new to Dynamo and to Python scripts as well.
I’m creating a Dynamo routine to create sheets in Revit from data in an Excel file.
I wish to set some sheets parameters as well (Drawn By, Designed By, etc).
Each Excel column contains all data for one variable (i.e. Drawn By), so I get several Dynamo lists to be fed into Revit.
When it comes to Sheet Issue Date I get dates formatted like “11/07/2020 00.00.00” and I want to reformat them to something like “11-07-2020”.
I tried to create a Dynamo script with
It performs good if I feed in to Python Script a single string, but I’m struggling to do the same with all the values from within a list.
Following the Python code and a screenshot:
import sys import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * from datetime import datetime # The inputs to this node will be stored as a list in the IN variables. # Place your code below this line str_format = IN myDatesList = IN myNewDatesList =  # Assign your output to the OUT variable. for d in myDatesList: myNewDatesList.append(datetime.strptime(d, "%d/%m/%Y").strftime(str_format)) OUT = myNewDatesList
Thank you in advance for your support.