Dynamo sets in parameter only the last element in a list

Please help me! I’m only one step away from finishing a script.

I’m trying to add the information about layers and their thickness as a custom parameter into the walls themselves. I’ve got the materials, and thcikneses extracted. I am able to make Revit put the in the correct walls into the correct parameters (multiline text). But for some reason Dynamo only puts in the last material from the list of materials for that given wall. What do I have to do with the list to make it work?

I’m using Dynami 1.3, and extracting wall information threw the cloclwork package.

Well I’m guessing you’re trying to modify type parameters. And if you’re modifying type parameters for a bunch of instances of the same type, only the last change is going to be visible.

Yes, I’m modifying type parameters. So Revit understands every line of the sub-list, as a single independant change? That makes sense. So how can I change all the elements of the sub-list into one multi-line text? I’ve tried using array to string but that changes the whole list into one blob of text…

Pls upload files or at least show us full graph with all unwrapped inputs

If you have 3 different wall instances of the same type and try to set their parameters to 3 different type values Revit is going to apply the values of the first set to that type, then the second set to that type, then the third set to that type. Since they’re type parameters all instances of that type will change. Revit is making all the changes you asked it to but you’re only left with one set of values because they’re type parameters. You need to create new types if you want different values.

Tomasz, here you go:

warstwy scian5 - czyszczony.dyn (51.7 KB)

Nick, it’s ok. I don’t want to add different parameters to different instances. I want to assing the parameters by type. All instances of the same type, with the same parameter.

OK, so what I would do is get a list of the unique types from those family instances. Then set the parameters for each type. I usually find it easier to set type parameters via the family type than by family instances, and it means you only need one set of parameter values per type.

I do think I’ve done that. Used “All placed family types of Category”, and the right wall information is put into the right wall types. The problem is that I don’t get the whole list put into the parameter, only the last thing on the list. For example Wall type “SC Z1d” ends up with the parameter “Powłoka antypyłowa”, when it should get “Żelbet /n Powłoka antypyłowa”, the next wall type only gets “Farba - biała” but none of the previous material names.

Probably an issue with list structure then. It looks like you have one Parameter but multiple values for each type?

You could say that. The parameter in the wall is a multiline text, that is supposed to be filled with the wall layers, that in the list, as I understand, are all seperate values. So instead of adding all those texts to the parameter, it is overwrited with every single one of them and only the last one stays.

So the question now is:

How do I transform the list, so that the elements in the sub-list, that is the material names, become one string of information that can be put into the wall type? At the same type I need the list to be still in the exact same order, and propably add “/n” in between the materials so they still look like a list?

I do have to mention that I am an absolute begginer in Dynamo and I need everything to be explained very simply. :slight_smile:

@LOESCH_PK See if this approach works for you …
stringJoin

1 Like

Vikram, this worked. I feeded the String.Join directly with the list, and added a List.Flatten by one after. All the walls recieved a multiline text containing their layers. I’ll just repeat this for the layer thicknesses. I’ll propably bump into some more problems on the way.

Thanks everyone for your help! You are awsome!

24

1 Like

Good to know it’s working.
One little tip - Explore List levels (by clicking on the arrows besides the input ports) as an alternative to List.Map

Ok, here’s another problem. I’ve made the dimensions of wall layers in a simmilar way that the materials, but I need to add a “cm” suffix at the end of every number, and then replace the “0.0” values with a “-”, and of course without the “cm” suffix.

I’ve managed to add the suffix in a not very elegant way adding first a “cm” seperator and then adding another “cm” suffix at the end of that multiline of numbers. Is there any better way to do it in one step?

How can I now change the “0.0” with “-” and delete the suffix, or just add after this change?

38

Combine your numbers with the suffix, replace the 0.0 values, then convert to a single string.

1 Like

Awsome Nick! Thanks! It works as intended.

If you guys still feel like helping a newbie I’ve got another problem in another thread. :slight_smile:

1 Like