Send Value From Winform back to Dynamo Zero Touch (Node) Class that called it

Send Value From Winform back to Dynamo Zero Touch (Node) Class that called it

rvtquestions
Advocate Advocate
397 Views
0 Replies
Message 1 of 1

Send Value From Winform back to Dynamo Zero Touch (Node) Class that called it

rvtquestions
Advocate
Advocate

To simplify the situation at hand, as the title suggests:

 

I would like to know the best practice to send the resulting value (whether it is a user selected value from a combobox or a list of values/elements/etc from a List Checkbox or TreeView) back to the Dynamo Zero Touch Class/Method that has called it. I am familiar with calling another class with the values from a winform but again what I want is for the result to return back to the class/method that called it.

 

So in example:

 

Winform Code:

internal partial class RvtForm : System.Windows.Forms.Form
{
//Does some procedure populating a combobox or List Checkbox or Tree View for user to select values from

private void button1_Click(object sender, EventArgs e)
{
//At this point how do I send the Selected Value back to value() that called this winform?
this.Close(); }
}

Dynamo Zero Touch Code:

 

public class Interface
{
     public static List<some identifier> value()
     {
     RvtForm form1 = new RvtForm();
     System.Windows.Forms.Application.Run(form1);
     some identifier result = value(s)/element(s)/etc from form1;
     return result;
     }
}

I would need to know this because the Zero Touch Node will run the winform, the user will select some values from the winform, click a button to confirm, which will trigger to close the winform, I would need the values then to become the output value of the Zero Touch Node to move on to the next node in the sequence of the overall Dynamo Script. Any ideas? Thank you!

 

398 Views
0 Replies
Replies (0)