Warning appeared when want to import abstracted time from Excel to Revit modelparameter

Hi there for anyone who is reading this topic. Really appricate for spending time on this with me.

I am a university student who is working on a final year project for sensor data and BIM linkage. I have already created a complete workflow for importing the sensor data recorded on Excel into the Revit model. However, I face the warning as shown below while having the time and date abstracted as shown in the “Time” group but got a result of null in the"Insert to Revit" group. May I ask for advice for this issue so as to facilitate my study. Thanks.

Abstracted Warning:
“The best overloaded method match for ‘Revit.Elements.InternalUtilities.ElementsUtils.SetParameterValue (Autodesk.Revit.DB.Parameter, double)’ gas some invalid arguments”

Try converting the time to a string. Also, make sure you’re using list levels if you’re trying to write to multiple elements.

Thanks for the quick response! Really appreciate it.

However, I have trired to covert the code block “time” to string but same warning appear in the below screenshots.

What type of value does the “Time” parameter expect?
Also can you put an Object.Type node in off of the List.GetItemAtIndex node so we can confirm the data type?

Thanks for joining the discussion!

The value “Time” parameter expected is exact the same of List.GetItemAtIndex for showing the date and time into the Revit family parameter. I have tried to put the Object.Type node after the List.GetItemAtIndex node but the paramter shows up in Revit model become another thing which is shown below as well. May I ask how to address such issue, say importting the exact listed time under List.GetItemAtIndex node to the Time parameter in Revit. Thanks.

The partial workflow after adding Object.Type node:

Updated parameter after workflow update:
image

The Object.Type node is indicating the issue. You don’t have a string, but a DateTime object. Effectively Revit was asking for a chicken sandwich, and you’re giving it an elephant, and Revit’s response was “I can’t put this on a plate.”

Now that you’ve pulled the Object.Type it’s text, but not the right text (a peanut butter and jelly sandwich instead), so it’s working on the Dynamo side, but not the Revit side. This does confirm we want a string (sandwich), but we still need to get the right string.

Put a String.FromObject node in where the object.Type node is. This will convert most items into their string representation. If the date format isn’t right, you may need to do some advanced conversion by pulling the parts of the date out (Datetime.Components), converting each to a string (String.FromObject), and joining them in the right sequence (+ node) before wiring it into the SetParameterValueByName node.

1 Like

Thanks for the reply!!!

It works and really thanks for the detail explanation which clear my misconception. Now I can get the time for the parameter.

image

Once again, really thanks for the assitance!!!

1 Like