Reorganizing Lists

Hi,

I am looking for a way to reorganize a list based on another list. I have provided a screenshot for more clarification. I am looking for a way to reorganize the values in the “SetIntersection” node to match the order that is in the watch nodes. (i.e. 1,7,2,14,4)

Could you post the graph itself or a screenshot containing more of the nodes preceding what is currently shown? It’s difficult to determine how the data is structured before going into the SetIntersection.

Thanks for the quick reply. I have provided a link that contains the Revit 2019 model and dynamo script. Please let me know if you are having trouble with the files.

https://drive.google.com/open?id=1BRcDyk87p-4ZaiYyPHLk4cl3HMJht7hs

@PhillipA

1 Like

I am trying to assign the correct beam number to my lines loads that are in my model but they are not in the correct order.

I need help creating a code block statement that will do the following:

while holding the first value in my watch nodes (i.e. x1.1 , y1.1 , xx1.1 , yy1.1)
loop through the values that are part of the beam start and end X and Y coordinates with an if statement similar to below.

if x1=x1.1
&
if y1=y1.1
&
if xx1=xx1.1
&
if yy1=yy1.1

Once all the if conditions become true then I would like to get the number from SetIntersection.

For example:
When the 4th number that is part of the beam start and end X and Y coordinates become equal to the the 2nd number in my line load start and end X and Y coordinates I would like to obtain the number 7 in SetIntersection and assign it to a list.

The final list will be in the following order. 1,7,2,14,4

image

Did my reply answer your original question?

No but I appreciate your reply. My initial post was not as clear as to what I am trying to do. Do you know how to code what I am trying to do in my latest post?

@PhillipA Please provide your dyn and rvt fiiles or a link to it. Thanks!

Did you try the link that I provided above to my google drive?

@PhillipA ok I got it.
It’s still confusing what you are trying do to. :thinking:

Do you want to compare each couple of nodes ?

image

or all at the same time?

What happens when the condition is false?

The items in all the watch nodes are in the correct order. I need help comparing each watch node with the items in each List.GetItemAtIndex. If a value is false during the comparison then the code must step within the List.GetItemAtIndex until the value is true.

Try clicking on the beam in plan that has a line load on it. Then take at look at the project browser on the left and view the “Unique ID” for that beam. I am trying to assign that value to the “Beam Unique ID” that is a parameter for the line load that is associated with that beam. Make sure that you have the line loads turned on in the visibility graphics under the analysis tab.

Its not that no one knows how to solve. It is that people react more positively and will show more effort when it feels like it is being reciprocated. The issue is actually pretty easy. Also a higher barrier of entry will stop people from bothering. I don’t have Revit 2019. If the issue is all numbers and sorting, making a dummy dynamo file for people to test on will make more people try. The fact I had to make my own almost made me not want to bother replying.


Edit: Updated to simplify a few nodes at the end.

1 Like

I understand where you’re coming from and I appreciate you taking the time to create the script. I provided my script but it was associates with a Revit 2019 file. I will try to make my post more clear in the future so that I do not have to duplicate them.

1 Like