Set Parameter Value from value in another element

Hi there, first post here. I’ve been dabbling in Dynamo for a while and we are using it more and more as an office.

I’m currently looking to create a script that allows me to take a parameter value from one element (a generic model with a text parameter named “Apartment Type”) and place it in another (an area with a similarly named parameter). I’ve got it to work when there is only a single set of elements but when there are multiple elements Dynamo places the parameters in the wrong items.

I know i need to make a list etc but I’m completely stuck as to how to get any further. Any help would be very gratefully received!

What do you mean wrong item? So the parameters appear, but not on the correct area?

If this is the case, you can see dynamo sorts elements by their id, so you have to add some logic to your graph, so dynamo can figure out which parameter to copy to which area. You can use the “Elements in Room node” from archilab, or find another solution.

If you have to use areas, in the rhythm package there are some area related nodes

Yes that’s exactly what i mean, Dynamo has sorted them by their ID and i need to relate the correct Area to the correct Apartment Type.

I need to do these by Area as opposed to rooms as we are required to do the rooms within the apartments as well.

Yes, you can use Areas.GetAreaAtPoint from the rhythm package, the order will be the same if you use something like this:


You can see the ids of the areas are not incremental

I get an error when i attach the Element.GetLocation node

Would i also need to do the same for my Generic model element selection too?

Please, try to understand what are you doing, not just blindly copy my 1 minute example, it was not intended to work this way.

You want to get an area of an element. so you have to find a point of an element (this is the element.location), and than find which area this point resides in. GetAreaAtPoint= get area at a point.

It’s so easy from this point, use your brain!

If you still can’t figure out in one hour, I will tell you the solution.

I hope you already figured it out

That still doesnt work. It actually seems like I’m further away than before as now none of the parameters get filled in, whereas before they were filled in but in the wrong order. Thanks for trying though :+1:

If both the Areas and the Apartments have something in commen you might be able to use the List.SortByKeys node with the key’s being the parameter that’s the same for both elements.

Yes i think this may be my problem. I can see that they both occupy the same apartment “space” but i cant think of a way to get dynamo to “see” that. I was wondering whether to do it by a spline and order the items along the spline?

I’m new to Dynamo and unfortunately for me my brain doesnt think in the same way dynamo does

Hi @r.preddy,

You can try with a containment test. In this example I am using area boundaries to create a polygon, and test to see if the location point of the Generic Model is within a given Polygon.
Before testing, i project the location point onto the same plane/surface as the polygon. If your Generic Models Z-value is 0, then you can leave this part out.

Thanks Martin, that totally blew my mind!! I tried it but unfortunately it didnt work and I’m not clever enough to understand why!! haha!! But thank you for trying for me.

No worries :-).

If you post a screenshot, we can try to troubleshoot, or even better; opload a small sample file that replicates your usecase. It would be a lot easier to provide an exact solution :slight_smile:

2 Likes

Thanks for the offer Martin that is really good of you.

Somehow I’ve managed to get it to work, I’ve no idea how!!! I think it might have been getting confused previously as i hadnt created areas for all of the apartments i was just testing it on a few on one floor, so i deleted all other floors and set areas for each of the apartments and ran it again and it seems to work now?!?!?

No probs :slight_smile:

Good on you for making it work, but I’d watch and compare the values closely. I think you are a very lucky man, if you managed to transfer the correct values, without doing any kind of sorting :wink:

1 Like

Thanks Martin, I will certainly be keeping a VERY close eye on it!!