At this moment I’m working on a dynamo script to adjust multiple (instance) parameters for a loadable ‘electrical equipment’ family in my Revit project.
First of all there are 5 types of this Electrical Equipment family which I need to filter them by levels. After filtering them by levels I need to adjust the instance parameter
“verdiepingshoogte”
For an example:
All the type families on the 1st floor needs to be 2750
All the type families on the 2nd floor needs to be 2620
The familiy instance parameter is a shared parameter. Also tried this with a type parameter but didn’t work
After solving this problem I want to add more nodes to adjust Yes/ No parameters for the five family types but those nodes encouter the same problem as I described in this topic
Thanks for the help but it doesn’t solve the problem. If I do what you’ve mentioned it applies the value parameter (in this case 2750) to all of the family types.
For my case it’s necessary to apply different values to the family types on different floors. The family types on the first floor has to be 2750. The same family types on the 2nd floor has to be 2620 and on the 3rd floor it has to be 2500 for an example
In this case there are 5 family types (2 on the first floor, 2 on 2nd floor and 1 on 3rd floor) The filtering did work but as you see I get the same problem
But if I do that, it adjust the parameter for all the family types despite the floor level. So how do I make a family type selection by level if I’m not filtering them by level?
I’ve uploaded it on wetransfer due to the file size. It’s in the following link: https://we.tl/Kf8excB6Ut
I’ll try to explain it once more
In the image below there is an example which I want to achieve. You can see the electrical equipment family hosted on a wall in 3 different levels. I want to adjust the instance parameter “verdiepingshoogte” from the family to the same value as the level height.
So for all the family types hosted on the “BG peil” (level 1) I want the instance parameter set on 2750
For all the family types hosted on “VD1 Peil” (Level 2) I want the instance parameter set on 2620
And for the family types hosted on “VD2 Peil” (level 3) set on 2500
You’re still trying to set the parameter for the Level (which doesn’t exist). You need to filter your Elements based on Level so you can set the parameter for the Elements themselves.
(You’re also checking to see if the name of your selected level is the same as the name of your selected level. You’re comparing the same thing and returning a single true value. That’s why you’re only getting the first element filtered. You only have one boolean.)
Just remove the “quotations” from the lower codeblock (notice the difference from my fist answer), then you’re good to go. After downloading your projectfile, i realised that this input should be numbers instead of strings.
But for my own understanding (I’m just a beginner in Dynamo) what happend actually here? It’s just something I want to understand if I need to edit the script it in the future.
First step is the selection of 5 different Family Types, and that’s why you get a nested list (or list with 5 sublists) of Family Instances.
The “Flatten” node flattens these sublists, and you get a simple (flat) list of (29) Family Instances.
This is the list you want to sort, so you connect it with the “List.SortByKey” node (top/straight line).
Now you have create a key by which you want to sort this list, so you ask all 29 elements what is the value of your “Level” parameter, and you receive 29 level objects.
The next node converts these level objects into simple text strings. This list with 29 strings is now your key for sorting and you also connect it to the “List.SortByKey” node.
The “List.SortByKey” node now sorts your Family Instances, so first all Family Instances on Level 1, next all Family Instances on Level 2, and so on.
Now you want to chop this (sorted list) into nested lists (or list with 3 sublists), this is what the “List.GroupByKey” node does.
The last step is to assign the values to the “verdiepingshoogte” parameter. All elements in the first sublist receive the value 2750, all elements in the second sublist receive the value 2620, and so on.