Program custom nodes with VB.net


#1

Hi,

I am programming custom nodes with VB.net and run into many problems. What is the best place to find help? I figured out how to use the Zero Touch approach, but what next? I developed some custom components with VB.net for Grasshopper, and want to transfer them to Dynamo. Anybody did that already? Any advise?

E.g. I want to load, display and edit a *.csv file in a listview on a windows form. At some point you have to show the form. Easy with myForm.show(), but it shows behind the Dynamo window. I need an object that implements System.Windows.Forms.IWin32Window to put inside the () to make sure that it stays on top of Dynamo. What object is that?

Is this the right place to discuss this kind of questions?

Hans


#2

Hi Hans,

When you say “custom node”, do you mean that you want to create a new node which has customized UI?

You either can create your own node and make Dynamo loads it when Dynamo starts up, or you build .net libraries and load it after Dynamo starts up (a.k.a., zero touch approach that you tried). For the former, there is an example in Dynamo\src\Libraries\SampleLibraryUI.

The difference is, unlike customized node which allows you to do some UI operation (for example, selecting a item from dropdown list, or in your case, edtiing csv file) before clicking “Run” button, nodes from zero touch libraries only get evaluated when you run the graph, and normally they won’t do UI operation during execution, so I’d suggest you may try to create your node.

Regarding to the form shows behind the Dynamo window, I only have limited knowledge about WinForm, have you tried “TopMost” property for your form?


#3

Hi Yu ,

Thanks for answering. The UI can be similar to normal nodes, but I need to display a windows.form with a listview and some buttons in order to display, edit and save a *.csv file. Windows.myForm.TopMost() works, but was considered rather rude while developing the Grasshopper plug-in. You are probably right that I should use the other approach for creating my nodes, but it looks a bit more complicated. Wanted to try Zero Touch first. But if they don’t UI operations… E.g. I would like to give the user the opportunity to add inputs to a node… Would that be possible?


#4

Found the example code. But how do I find the dll’s to reference. Like e.g. Dynamo.UI.Commands?