List management/Level issue

Hi everyone,

I am looking for some assistance with a list management issue that I am having.
I have a script that places builders work at various intersections. The script also applies 3 parameters to the builders work for now, namely:

  • Diamter/width
  • Height/Depth
  • Reference level

The Reference Level is the parameter which I cannot seem to get applied to the builders work correctly.

In the image above, I am looking to get the reference levels to apply correctly. What I need to happen is the following:

  • Index 0 from list 0 of the List.Chop node needs to apply to each index 0 from the second level of the FamilyInstance.ByPointAndLevel node.
  • Index 0 from list 1 of the List.Chop node needs to apply to each index 1 from the second level of the FamilyInstance.ByPointAndLevel node.

And so on…
Hopefully the slightly messy image below better depicts what I tried to describe above.

I cannot transpose the list as this cause issues with the other parameters that I need to be added. No matter which way I try and do this, there is always 1 parameter which is not happy and seems to be in the incorrect order.
I have also tried feeding the level input the “Unchopped” reference levels to no avail. I have tried all combinations that I can think of with regards to lacing and list levels & I just cant get this to apply the way I want it to.
I also don’t seem to be able to use the SetParameterByName node after I have rearranged the list order, as the parameter I am trying to set is read only and needs to be set by this FamilyInstance.ByPointAndLevel node.

Please, any assistance will be hugely appreciated!
Any thoughts?

Thanks!

@mitchellpUDG9S I think I understand what you are trying to achieve. List comprehension in Dynamo is always tricky. Try the following:

  1. Remove the List.Chop node and replace with a List.Create node, structuring your list of Level elements into a single list.

  2. Use a List.Flatten node to flatten your list of points by an amount of 1 so that the data structure matches my image. You may need to use a list at level in the List.Flatten node to achieve this.
    image

  3. Set the Lacing on the FamilyInstance.ByPointAndLevel to Longest.

3 Likes

Hi Pete,

Thank you so much for the advice! It worked perfectly!!
The only thing I changed was to not flatten the points list, as I actually needed the “Empty List’s” in there to get the correct level assignment for different pipes on the same floor. Then I applied your advice further down my script as well and everything fell into place.

Thanks again!!

1 Like

One more thing I actually noticed…
After the first run my project looks like this:

As you can see, a lot of the families have not been placed correctly, they have been placed, but are floating above the crop line.
After the second run, everything falls perfectly into place:

Any ideas on what is going on here? And how to get it right the first time?

I’m glad that helped. As for not placing it correctly the first time, I cannot repeat that behavior in the sample model I made. It could be a number of factors, like the way the family was built or what you are doing with the families in Dynamo after their placement. If you share the family and script, I could help you troubleshoot further.

Thanks very much Pete!

I have realised what my problem was… Very much user related :slight_smile:

Thank you for taking the time, appreciate it!

1 Like