ZeroTouchNode Combo Box / Dropdown list with Dictionary as Input

Hi I’m trying to pass a dictionary to my UI node that I’m making with ZeroTouch…

My dictionary consists of key from strings, and values from lists

I’m having difficulties as I’m still new in creating UI and integrating it with dynamo
Any tips how I should process my dictionary so that it can be displayed as a dropdown list and return the value? If i’m not mistaken, combo box only works with lists?

Also, how does one have multiple outputs with zerotouch nodes?

This is what I have so far:

public class MyNode
{
    public List<Object> UI_Interface(Dictionary<string, List<object>> dict)
    {
        List<Object> listReturn = new List<Object>();
        myForm window = new myForm();
        
        var res = window.ShowDialog();

        //check if there is any input
        if (!res.HasValue && res.Value)
            window.Close();
        
        //draft
        var data = window.comboBox.SelectedItem;
        listReturn.Add(data); 
        return listReturn;
    }
}

You can download example code here:

In the code you actually use a Dictionary. The Key is the name and the Value what is returned. It is possible to return an object instead of a name, but it might be very difficult to do so. At least the bast way is to fill the Dictionary with the name and the Object Handle, which can be converted to an object.

The node always returns one object, it is not possible to return multiple objects from a drop down. Maybe you can have a look at certain packages which are able to show listbox with multi-selection dialogs.

I solve that in

To create a Node with Multiple outputs see Multiple Outputs section on that page.

https://developer.dynamobim.org/03-Development-Options/3-3-python-scripts-in-csharp.html