Multiple outputs for Python node

Hi all,

I’m new to Python in Dynamo and I’ve drafted a python script with help of a colleague on a piece of paper. My goal is to have 3 lists after the script hase run.
1 list with Z-coordinates, 1 list with X-coordinates and 1 list with rebar diameters.
I haven’t created the python script in the node yet so I can’t show it to you, but let’s say it works and I get 3 lists from it. Then How do I get the 3 lists to the output?

Is it like:
OUT1 = Z_coords
OUT2 = Radii
OUT3 = Diameters

or must I first combine them to 1 list? Of so…how is that done in Python?
So I have this:
Out = combined_lists

Hope you can help!

Kind regards Mike

OUT = Z_coords, Radii, Diameters ?

2 Likes

After some googling I found:
OUT = [Z_coords, Radii, Diameters]

and that would make sence. [ ] = an empty list
[Z_coords, Radii, Diameters] should mean a list containing the following lists.

Thanks for your input @interactiverendering! That helped me with what I found! :+1::+1:

If @interactiverendering solved your problem please mark his comment as solution (and maybe give it a like).

:+1:
I know that and I will, once I’ve tested it and made it work.
Untill then… I don’t know if it works.

Ah, great.

Made me think you had it fixed. There’s quite a lot of people who just don’t do it, so I’ve been spamming that comment a bit.

:joy::joy::joy::joy::+1::+1:
I can understand that!
What I mend with that remark is that it confirmed a method I found myself after some Googling.
And more confirmations of the same thing leads to a solution.

But I’ll check it when it’s working. :wink:

1 Like

It works! NICE!!

OUT = [list1, list2, list3] :+1:

1 Like

But the problem with the lists is when we want to simplify some code, for example when I have a list of lists and I want to set that lists in the parameters of others nodes without using GetValueAtIndex a lot of time, we could use a python script that could receive a list and give as outputs diferent variables.

2 Likes

Having something like this would be great. I have encountered the same problem.