Run node command from external UI

Hi mates,

I have been investigating for a while but I can´t find how to run a node command from a external UI in a viewExtension. For instance, in the ¨Select Faces¨ node, how could I call the Select button on a specific node and set the value from an external window. My aim is to run Dynamo UI-Less and set those values back to Dynamo.

Any tip would be much appreciated,

Look into Data-Shapes.


Thanks @Nick_Boyts for your message!
That is not exactly my aim, I am looking to call the buttons of workspace nodes from the API in C#.
I found the Select command that could replicate the funcionality but it is not actually like pressing the button of the node.

Any tip @Michael_Kirschner2 would be much appreciated.

1 Like

I found a way to access the method class of the nodes via;

 public static void RequestRun(string filepath)
        string validjson;

        Exception ex;
        NodesInfo.isValidJson(filepath, out validjson, out ex);

        NodesInfo.DynamoPreferencesData nuevo = NodesInfo.DynamoPreferencesData.Default();

        NodesInfo.OpenJsonFile(filepath, validjson, nuevo, true, out WorkspaceModel workspacint);

        string lista2 = "";

        List<string> listaconvalores = new List<String>();

        List<MethodInfo> Runtimemethod = new List<MethodInfo>();
        List<NodeModel> Nodos = new List<NodeModel>();

        foreach (Dynamo.Graph.Nodes.NodeModel node in workspacint.Nodes)
          var nodetypes = node.GetType();
          var method2 = nodetypes.GetRuntimeMethods();
          Runtimemethod = method2.ToList();
          Runtimemethod[1].Invoke(node, null);

I have got access to the method class inside the nodes;

Nonetheless, when I try to invoke the SelectionHelper to simulate clicking on the node button, the invoke method brings an error;

System.Reflection.TargetParameterCountException: ‘Parameter count mismatch.’

SelectionHelper method has no defined parameter to my understanding. What am I missing? Would you have work around on how to call nodes methods to simulate the clicking on the button?

Thank you,