Assign Parameters to Objects depending on what Mass (or Floor) They Are / Stuck for long time

Hello everyone,

I am trying to make an apparently very simple script in dynamo. I just need to transfer the text in the parameter ‘Zone’ on the Masses to the Lighting Fixtures with the same Zone parameter. Please see the image below.

I have selected, on one side, the masses and on the other the lighting fixtures. ‘Converted’ the lighting fixtures to points and flatten the list of the the masses so that the indexes match.

I get the interesection correct but I am struggling on the step of matching the levels of the 2 list before List.FilterByBoolMask.

I think the way this would work is if I get only true items in the list but keeping the correct index. Is it possible to do this?

I have attached below the full script for now, maybe someone has done it before and is willing to help.

Thanks a lot!
J

You can get it working by careful use of lacing and list levels
Here I have used spaces instead of masses.
Set the Geometry.DoesIntersect to cross-product so each fixture is compared to each space/ mass, then be setting the list level of the List.FilterByBoolMask to mask @L2 we can create a list that has the same number of lists as the number of spaces/masses. Each is a list of the fixtures intersecting the geometry.
Using the correct list levels on Element.SetParameterByName will then rename the fixture parameter with the value selected (In this case ‘Name’)
A few tips

  • watch out when using cross-product as it can get gnarly (47040 comparisons in the image below)
  • When taking a picture of the workspace you don’t have to zoom out, rather zoom to a level where text is legible and Dynamo will capture the full workspace
2 Likes

Hi @Mike.Buttery Thanks a lot for your solution! It worked for spaces but I also for roofs or floors! Thank you very much!

1 Like