Insert collected data

Hi all,
I have managed to get my previous graph to work and have a nice clean list of concatenated values. A huge thanks to Salvatore!

What i need to do now, is place these values back into the project families in an empty parameter and Im not sure how to makes sure the right information ends up in the right family.

Here is what i have done so far:

  1. Used categories - All Elements of Category
  2. Used Element.GetparameterValueByName
  3. Created a list
  4. Filtered out any blank values
  5. Added a “-” separator to the list
  6. Collected some project information and used teh above to create a single string
  7. Joined the two lists together
    I now have a nice string of data AAA-BBB-CCC-DDD-00-MECH-PUMP-0001 etc

I now need to add this concatenated data back into the same family that this was collected from. How do i do this? If i use Element.SetParameterByName how do i filter the elements to be the ones that created this data in the first place? Im guessing element ID’s, but i have not idea where to start with or collect the element ID’s for the filtered items

Any help appreciatedConcat

the trick is in keeping the original list structure the same, so do not filter out blank values or sort your list
but having a key to match the list indexes (Id) would be better

So what is this empty parameter called?
Insert that as a string into the “parameterName” input.
For the element input it depends whether you want to set these for family types or family instances. But you have to tell me for what you want to set it, because I can’t look in your head, or Revit file for that matter.

Actually, that might be the easiest way. I thought that filtering out the blanks would be a good idea, but now having to add this back in, i think you are right.

If you are using bool masks, you can also just filter the element list alongside the parameter/strings you filtered to get the same index list.

Needs to be this parameter in the families, but only the ones in the filtered list.

This is an instance parameter

But which elements specifically is what I’m wondering about?

Concantonate.dyn (30.6 KB)
I am using a category / All Elements of Category method, this way it can be used with some flexibility. I then filter out any values that are “blank”.
I have attached the graph, it might make more sense. Thanks!

The blue group called this. Can you try that?

It is just the original list of elements filtered using the same bool mask you used to filter the parameters. Should be same exact order and without the empty’s.

1 Like

Without your Revit File it’s rather difficult to actually figure out what you’re supposed to be reading from this.
Fact of the matter is that I still do not know what elements you want to change.

…following up on @kennyb6 reply, you should be able to optimize your graph


This is my test file.
I’m not trying to change anything. I am collecting data from families and project data, stitching them together and then wanting to push that concatenated value back to those same families in a blank parameter.

I tired to use a combined code block, but it would not work for me. For some reason it always only gave me the first result and not all of the list.

Here you go… without knowing what the exact result should be

In my test I deleted a parameter value to have one element falling out of your list.
Concantonate.dyn (17.8 KB)

I would expect this to be the result!?
Concantonate2.dyn (15.6 KB)

Sending the value back to the model is a trivial task…

Concantonate3.dyn (18.6 KB)

This is probably similar to what @erfajo does but this is my attempt.

Concantonate.dyn (20.7 KB)
I changed the bool mask from checking if it is not “” to check if it contains a “”. This way it will ignore an entire element if a single parameter of it has an empty or null value.

@kennyb6 try to remove a random parameter value, so you will have one element falling out of the list :slight_smile:

1 Like

Haha yeah I think i realized this right before you posted that. I already updated it to check that it doesnt contain any empty values using List.ContainsItem.

1 Like

both graphs do the job… funny little task to do :slight_smile:

1 Like

Thanks for this.
I have tried to re-create it, but i cant get it to work :frowning:
The project I have to work on is in revit 2015 and the Dynamo is pretty old (0.9.1), which i think is the issue.
I might need to upgrade the file