Designscript.builtin.dictonary.bykeysvalues()

i am upgrading all my nodes to 2.0 and i am getting this and do not know why

image

won’t be able to help without knowing more about your package - but my guess is that you are distributing some old dynamo dll with your package.

multireturn nodes will under the hood use the dyanmo2.0 dictionary type to marshal the c# dictionary type that mulireturn nodes use.

If the constructor can’t be found that means Dynamo 2.0’s core dlls cannot be loaded correctly - that would not happen unless a package tried to load an old version of dynamo at the same time or something that would alias that method…

1 Like

Keep in mind that in Dynamo 2.0, lists made with {} in 1.x or earlier will be broken because lists are now made with [ ]. { } are instead used for dictionaries, which is what it looks like that error is trying to tell you.

Double check anywhere you are using DesignScript that you have replaced all { } with [ ].

@Michael_Kirschner2 thanks for that I will look to see if I am pulling in some old dlls. I had set it build using the latest beta nuget 2.1.xx.

I might use the stable 2.01 dlls.

i managed to find the dll issues , i had to rewrite the way i started up dynamo inside Maya using some of the newer code from the Revit repo. i have a few other issue that i am working through (like my nodes showing up twice. but the biggest issue right now is when i add a node and save the file the node is not there when i open the file and get this error in the console.

This graph has a nodeview with id:0f54d295-24c9-4c5c-ad14-3958a5e9fb0b and name:Get Selected Mesh, but does not contain a matching nodeModel

please read this if you have not already:
http://developer.dynamobim.org/03-Development-Options/upgrade-nodes-for-dynamo-20.html

your nodes are failing to deserialize.

i have read that. and i am working through it. the new seralize/ deseralize looks so much more complicated than the previous method which was complicated enough. but now that i know that is what the issue is i will try to implment it correct. nodeModel really is an ungainly beast. …grasshopper nodes are so simple and elegant … :slight_smile:

@Michael_Kirschner2 i just made the entire DynaMaya Development public on github. everything works great with the old 1.3 code. the first node to try the new code is the getSelected mesh node found here. based on the dropdown example there is a ton of code to add to get a single input to serialize.

@Robert_Cervellione1 the link you posted appears to be the code before you tried updating that node? What does your current 2.x branch look like?

sorry i cleaned up the git repo when i made it public. here is the new version

Be careful with your non serializable public properties - namely the delegates, these cannot be easily serialized and deserialized with json.net’s standard serialization so when deserialization occurs it probably fails, mark them with [jsonIgnore] attribute.

@Michael_Kirschner2 so that was great. adding the [jsonignore] to the delegates worked. now i have to implement the actual serialization/ deserialization of the nodes data.