Creating Package that contains both Zero touch & Custom UI nodes in Visual Studio c#

Hi!

I’m wondering if it’s possible to create a package that has the following structures:

Category
SubCategory
NodeA(Zero Touch Node)
NodeB(Custom UI Node using WPF)
NodeC(Zero Touch Node)

Where I’m mixing the use of zero touch nodes and custom UI nodes and still have the structure above.

Thanks

Its possible, but not within the same Visual Studio project as you cannot mix Zero Touch with MVVM (assuming that’s the object model you plan to use with WPF).

If you use the same namespace (what you call ‘category’) and class (what you call ‘subcategory’) in both libraries, the resultant nodes will be organised in the Dynamo library together in the structure you need. Alternatively, you can override the organisation of nodes in the library using the DynamoCustomizations.xml. If you download the Mesh Toolkit from the package manager, you can examine its xml from the root directory as an example.

1 Like

Thanks Thomas. I’m using the customization xml right now and it’s working great. It’s just a bit unfortunate that the project needs to be splited between zero touch and “WPF Nodes”. But I guess there are no other workarounds.

I don’t see why they couldn’t be mixed as part of the same DLL, allowing you to order them as you wish.
Yes, the WPF one would have to call functionality from a separate DLL (from what I understand, @teocomi might want to confirm) but if you’re willing to split the code like that, it’s doable :slight_smile:

You can’t compile if MVVM and ZT are mixed in one project. I believe it’s a limitation in Dynamo’s node model

Can’t confirm as I haven’t tried but the Dynamo
Library itself mixes and matches them so it should be possible.

All I know is (for some reason) the method called in the nodemodel needs to be in separate assembly, see @teocomi hello world sample
https://github.com/teocomi/HelloDynamo

I can confirm, as I’ve tried it, and it doesn’t work! :wink:
Dynamo must have separate dll’s also. I think this limitation is documented somewhere on the github.

On the note of separate dlls, I have realized that if I use methods from a referenced external dll, I get an error saying dereferencing a non-pointer, where as if I create a function in another assembly in my project which does nothing else than calling my method, then it works. I find that quite strange. Any thoughts?

:+1: just had a look at repo and they are in separate projects indeed, at least the Core.Web namespace that I’m familiar with.

Quick question: Is it allowed to have a zero touch project and a custom UI node project in the same solution?

Because when I try, I can get it to compile but strange things happen.

I answered my own question through trial and error. It’s possible to do this :slight_smile: