MutableDictionary Auto Keys

I didn’t expect this to work but, I created a Pin Input Group and instead of a Spread<*> I set it to MutableDictionary<String, IFixtureAttribute> (where IFixtureAttribute is obviously an interface).

On my testing patch I was curious to see how is this being handled without having any duplicates and so on. And I got this:

image

My question is, can I force the MDictionary to use another Key (ie the Name property of my Interface) than the name of the Pin itself by avoiding use a FromSequence or changing the Pin’s input type?

Thanks

@nissidis

Very interesting question!
It’s not an answer, but I wonder if you would have seen this:

@yar yes! I have seen this, it feels like it is the other way around (naming Pins after Dictionary’s keys). I guess I want to force the auto assigned keys to something else (to an internal propery for instance). For now I am using the standard way:

There seems to be no way to rename input names without losing the connection

dict_input.vl (21.4 KB)

image

But yes, you can create the input pins by data stored or processed by your nodes

Hm, I think I didnt pose it properly, I don’t want to change the pin names “per se”, but change the keys on my dictionary (if this means that I have to change the pin names as well, then I wouldnt go that far).

In my experience, this feature works rather strangely, often glitches and does not work the first time. It feels a bit buggy. I’ve used it a few times to create dynamic nodes to send commands over a custom protocol.

By changing the keys, the pin names change as well. That’s my understanding of the design.

yes I agree on that, from my experience felt buggy especially when I was to introduce (accidentally tbh) a bunch of pin inputs.

There’s no built in option to do what you ask. Spread pin group with FromSequence is the way to go here.

2 Likes

@Elias yes, I imagined so. The pin inheritance is already pretty nice. I wouldn’t ask for more tbh although I did in my initial post. Thanks!