Excel to Revit parameters

Almost there!

I’ve managed to export a load of information out of Revit in to Excel, the problem is I’m trying to get the information back in to the family by using Element.SetParameterByName node, which has been unsuccessful so far.

Somehow I need to map the Mark value which is the Key identifier in both the Revit project and the Excel to enable to change the other parameters which are posing a warning in Dynamo. Please see attached screenshot.

Any advice would be appreciated.

Thanks in advance

What is the error?

Vikram,

Error msg as follows:

Warning: Element.SetParameterByName operation failed.
The parameter’s storage type is not a number.
Element.SetParameterByName operation failed.
The call is ambiguous between the following methods or properties: 'Revit.Elements.Element.SetParameterValue(Autodesk.Revit.DB.Parameter,

I’m not sure if this is the right way to go about changing the values in the family or not to be honest. I’ve changed the data format to number in Excel still not working.

Regards

Actually, the error indicates the parameter value should not be a number.
Use an Object.Type node to check if the type of values coming out of List.GetItemAtIndex
If it is a number, use String from Object to convert it to a string (assuming the value type expected is a string)

1 Like

Vikram,

I’m having a warning saying can’t be null.

Your problem begins upstream. Would help if you show more of your definition or post the file.
Assuming you’ve used Excel.ReadFromFile

Vikram,

I didn’t have the Boolean set originally but still have the issue.

Vertical Load seems to be alright now :slight_smile:

Going by what is visible in the image, seems like you have nulls at indices 1 and 2 which are causing Horizontal Load and Tensional Load to fail.

Replace the nulls like this…

Null values from excel? Something is wrong. Try ‘read from excel’ node from Archi-lab package

Vikram/Tomasz,

Thank you both

Vikram that boolean has worked fine, but the problem I’m having is that it’s renaming the Mark parameter in the project file which i don’t want. what I’m trying to do is as follows.

  1. export the pile mark numbers and the loads as they are to excel. (which I have done with bounding box so it reads from left to right)

  2. Add the loads in excel and bring back the loads into revit, that are associate to the pile marks that already exist in the project.

So i need to somehow tell dynamo that Pile Mark from Excel and Revit are the same instance of the family. Just change the loads.

If I’m not explaining what I’m after well enough please say, I’ll try and send some diagrams.

Cheers

Remove the SetParameterValue node that has Mark as the input for parameter Name

Assuming that the list lengths are equal, try sorting them by making changes as suggested below…

Hi James,

Try adding “List.Clean” node after “Excel.ReadFromFile” node. What it does is that it removes all the null values before you connect to your desired node.

Vikram,

This seems to work. I’m not what it’s actually doing yet but thank you

1 Like

Kulkul,

Thank you for this.

Regards

Vikram,

I’m not sure what I have done here, when I run the code attached its renaming the piles (see P numbers) instead of just changing the loads. Please see before and after screenshots and the code itself. Sorry for being a pain in the rear.

Thank you.

What you need to do is align all of the piles into pile mark order, then feed the elements into the pile loadings so element with p001 matches p001 from the excel list.

I think the following should sort it(below image), as i am guessing your excel does have them in pile mark order?

@James_Washbourne

I prefer to use RevitUniqueIDs for exporting and importing.

This could be another option. See below:

Taking the direction provided by @Brendan_Cassidy further…

2 Likes

Thank you

1 Like