Script enters endless loop when selecting multiple elements

Hi guys, so I wrote this script and it works perfectly fine if I select one element, but when I select multiple elements, it breaks down and enters an endless loop and I have to manually close down dynamo. So my question is how do I make this script, which works for 1 element work for 2 or more?

It’s most likely an issue with list structure and not looping through multiple elements. Can you show the outputs for running your graph on one element vs running it on two?

do you have 1 value for 3 parameters as i understand ? i think here is the problem

yes, it is the same value for three different parameters. its weird, i know, but thats the way it is here. It just needs to be different values for every instance of the family. But each instance has all three parameters equal to each other.

This is a little confusing. Do you mean it needs different values for every family type, but equal values for each instance?

There are many instances of the family type in the project. Each one has a different ID tag number. That ID tag number is populated accross three different parameters in each family instance. Sorry, for any confusion.

What is the result when you try running it on a single element rather than multiple elements, as @Nick_Boyts asked above

Ill have to show you guys tommorrow. But it works fine on a single element.

Please upload the dyn and asmall sample file too. I have a good solution in mind.

Convert 5VFD-RFD01 (pdf plans style) relief fan naming convention to 5RF-D01 VFD (excel style) SP TXT Equipment ID, SP TXT Equipment Name, and Mark.dyn (12.5 KB)
VFD_1.rfa (304 KB)
Here is a picture of it working. I dont want to run it on multiple elements since it is just going to enter an endless loop and not show anything useful anyways.
I am uploading the family and script per your request please see above.

Here is what is looks like on an “endless script” which apparently today, isnt “endless” lol

You don’t have any elements selected.
I’m still guessing that your data inputs don’t line up. Try running your graph with multiple elements selected, but don’t connect to the SetParameter node. Instead, connect to watch nodes for each of the SetParameter inputs so we can see what’s going into that node that’s causing it to fail.

The last picture was taken when I had multiple elements selected. It looks funny because it didnt work. Thats the problem. I am trying to run it again adding the watch lists, and removing it from the set parameter node like you said right now, but it is taking forever. I might have to kill it.

If you look at your Collector.CurrentSelection it’s returning an empty list.

Oh well maybe that is why it ran that time then, I thought I had them selected. But I definately have them selected now, and it is in an endless loop again now… :confused:

You should just need to change the GetParameterValueByName node lacing to cross product. Otherwise you’re not getting all the parameters you need.

Single element:

Two elements:

Well I changed my get parameters node to cross product and I got it to work on one selected item, the same as before. Then I toggled the boolean node and selected two elements and again, it is now running in another endless loop.

Can you post a stripped down copy of your model and specify which elements you’re trying to run your graph on?

I think this node is broken. I try to run it by itself with two VFDs selected and it craps out on me. The model isnt important, I already posted the family that I am using in a previous post. You should be able to down load it from there.

Are you switching the toggle between runs?

It very well may be. Especially considering I can run the same graph on multiple elements in a different project.