List. Inside a custom node and outside a custom node

Hi All,

I’ve got a problem with a custom node from the Clockworks 1.x package.
I created a script and given it to a colleague so he to can benefit from it.

BUT…the script doesn’t work/function the way it should on his system as it does on mine.
To my knowledge all the packages are the same and have the same versions.
Yet still it doesn’t work. So…I want to “decompile” all the custom nodes and simply putting the nodes inside the custom nodes in my main script. But I get and error on a simple design script block.
The error message tells me that there are "Multiple definitions for ‘List’ ".
So to correct this I think I need to write the correct definition infront of the line.

When I change:
List.UniqueItems(ft.Family);
to:
DSCore.List.UniqueItems(ft.Family);

the error is gone…but my question is: why don’t I see the error occuring inside the custom node??

Hi @Mike_Wellink ,

I am assuming that you have a recent version of the Archi Lab package installed.
Konrad has his own class named List in his dll, which causes dynamo to not know which List you’re talking about. To solve that, be more specific when calling the List class by writing DSCore.List . That way there won’t be any ambiguity anymore.

so in your case: DSCore.List.UniqueItems(ft.Family)

2 Likes

Hi @Mostafa_El_Ayoubi,

I do have the archi-lab.net 2016.12.7 package installed.
But shouldn’t I then call upon the Archilab.Grimshaw.List.List instead of the DSCore.List??
In order to call the List function with the correct definitions?

And still it leaves me with the question why it works without showing an error inside a custom node and not outside a custom node. Doesn’t “project rules” apply to all nodes even when they are in a custom node?

How does the custom node knows were to look?

@Mostafa_El_Ayoubi,

I hope your not mad at me…but I’m about to dismantel your UI++ nodes aswell. :sweat::sweat::blush::blush:

Or is there A way I can “zip” my script including all the used packages??
And mail it to my colleague so he can unpack it and use it?

The method UniqueItems belongs to the DSCore.List class , that’s why it is the one you should use.
The fact that it works inside a custom node is very interesting. If you try and create a new custom node and call “List” in a code block while having Archi Lab installed, it won’t work. So my guess (I hope someone will correct me if I’m wrong) is that when you create the .dyf, it includes the libraries that are being used at the moment of it’s creation just like when you compile code.

AHA…well that would make sense!
Then de “rules” do apply to all nodes even if they are inside a custom node…unless you specificly tell it to look somewere else.

Thanks for making me understand yet one more piece of this huge puzzle! :+1:

Haha :slight_smile: I personally don’t mind. I am well aware that it’s something people can do when I share my work in the package. I doesn’t harm or benefit me. But, still personally, I think it’s important to give people credit for their work. I’ve seen people take content out of nodes and erase the name of their creator or, worse, put theirs instead… There is no way to control that but I trust that most people in the comunity of dynamo users are good and will respect each other’s work.

1 Like

No way I’m taking credit for your User Interface!!!
I just got a 5 day course on Python for Dynamo from Paolo (Autodesk) and though I now can some what read a python script…I’m still a long way from creating what you’ve done.

Your UI really is the best custom node I’ve seen so far!
This realy gives me the tool to create a script anybody can use…well…if they have the same packages installed that is.

Oh…I’m about to update to your latest version. Did you alter the UI nodes lately that would “mess-up” my script? :blush::blush::blush::blush:
Or is that just trail and error?:joy::joy::joy:

That’s a fair question! I think it should be fine :slight_smile:
I would like to say that it’s risk free but you can never be completely sure… In case you have any problem you can always downgrade to a previous version though.

1 Like

Maybe @Konrad_K_Sobon can change this? It is so timeconsuming to type DSCore. :wink:

2 Likes

I don’t have a problem with that, but that’s a larger issue of how Dynamo handles scope of all loaded DLLs. I am not the first nor the last person that created a class called List.

2 Likes

Probably, but since this is the first time I’ve encountered this “problem” in a while I guess yours are the only package of any interest! :slight_smile: