If your Universe is R/GH use DataTrees. If not avoid them since these things are internal to GH and code’s portability (if and when your wings grow) … well … you get the gist of my message I do hope.
You can put anything to anything:
Say for instance that you have a List of meshes and you want to create a LOL DataTree with the following custom type:
In fact (pointless to the max … but good for practice) do exactly that right now (MTV is the MeshTopoVertices as Array and ADJ is the Mesh Adjacency Matrix [i.e. a VV connectivity as bool [ , ]).
This means that your Tree would contain (per branch) a single custom object (of type < Something >) … that would contain a lot of useless things etc etc (Huan Valdez espresso a must for unboxing).
WHAT a mess: you attempt to mix cats and dogs while everyone knows that cats are only compatible with blue alligators.
BUT before the politically correct (LOL) solution/salvation the 1M question is: what is your general plan/strategy? Stay in the GH bandwagon? If so you should use DataTrees for your nested collections (unless you need a List of some custom object [via a class etc] or is a matter manageable via Arrays). So List of List of List … well makes only sense if you want to do some “portable” code blah, blah.
I want to use the collection in another c# code.
To do that, I want to make a collection from my array.
And I use arrays to use as less memory as possible.
And yes, I am the one holding catigators in my garden.
I understand the part of the class, but when I tried Matrix for example, I have not learned enough so it seems to me. Sorry
I need to work harder.
OK, I’ll prepare a full demo case on that matter: how to use nested collections (for no reason), nested collections (for a reason) and other useless (thus usefull) things. That said Arrays may are faster … but they are a bit “static” and you can’t query them the way that you can in a List etc etc.
No, Peter, please, thank you but can you not explain it by a message.
If you see someone like me, let that person struggle for a bit
You are too kind.
What did I do wrong in my lists?
I changed the configuration a couple of times but I cannot get it working.
You were talking about classes
I tried that, I mean, I typed that.
Tomorrow a full demo case with alligacat objects (that would work here but not there: life sucks). BTW: maybe your planet doesn’t support catigators … so try a List of objects (hope dies last):
Well that something is that you love computers (bad/ugly/pointless things: avoid at any cost).
Anyway … this is the answer to the question that nobody asked (that’s the official definition of progress). The 3rd C# is for unboxing a List of some custom type … but the cost of unboxing, blah, blah. NOTE: cList is either a custom type thingy or something else: by what means can we prevent the C# re-executing a zillion times? (collection case: DataTree).
Tip: simplicity is the ultimate complexity > don’t use stupid collections. For the occasion the double [ , ] is the way to go unless you want to do tricks via classic Matrix Methods (LOL) or to query things (if so use Nodes, obviously with some more elaborated way).
And now the challenge of the day: find all the colinear triads of points in less than one week.