Exporting to Revit and merging multiple Lists to fill empty Values

I have been working on a small Script, that writes all my necessary information in Excel to further work in MSProject, but I have come upon a problem:

I have different languages in my project, so length =! länge =! and so on. So I am trying to combine these parameters within dynamo.

The precise problem:

List one looks like (5m, 3m, 15m, 0m, 3m,…) Next List :(0m, 0m, 0m, 3m, 0m,…). How do I combine these two values. I have tried with clockworks List.ReplaceNull, but that only allows to fill in with a static value, not another list.

I appreciate your help! Btw. please be easy on me. I have only started to work with Dynamo and I have searched for a solution for a couple of days now.

So, you need to remove empty values?
Can you share the files?

Well, not remove, but merge two lists into one, overwriting the null-values, with the value from one or the other list. If in the end some values remain null, because both are null that doesnt matter.

Yes, I can, but that will take a short moment. And its annotated in german.
(Nevermind. I cannot upload attachments, as a new user)
Here is a link: https://www.file-upload.net/download-14355104/AllElements.dyn.html

Thanks in advance!

Sample Revit file?

That, I cannot give you. I am very sorry, but its over 300mb and shouldn’t be released until after I have written the thesis.

Thank you for trying, but I will try and find another way.

.

create a sample file for what you needed with parameter.

Always make sure you’re dealing with the right objects first. Those are not Nulls, they’re just empty strings. Also make sure you’re using the most efficient list structure for comparing lists. If you separate the parameters into separate lists you can use a simple If statement to get the values you want.

valueA == "" ? valueB : valueA;

If valueA is an empty string use valueB, otherwise use valueA.

2 Likes

1 Like

Ok. First af all thank you both very very much!!!

I will make sure to be more precise with describing objects next time!

As of right now your solution works a charm Nick. I guess that is a python “statement” (lack of a better word on my side)? Since I will have to repeat this process for a multitude of parameters I will look into writing these more closely!

What did you mean with efficiency? I am aware of the fact that my solution doesnt look good, but with my skills I am currently unable to make it better. Anything you can point me to that I should look into?

And Vijay I will try your solution out right away, too. Thanks again for all the help.

The If statement is written in DesignScript syntax for a code block, that’s like the Dynamo native langue. You could do the same thing in Python though.

By “efficiency” I only meant “the best list structure for processing your query.” Comparing values is always easier when you compare one list against another rather than comparing coupled sublists like your original image.