11-19-2014 09:25 AM
So how do you get the .NET constant initialized to a list of strings? Did you do a Create->Constant somewhere, or can you specify a refnum's class by name?
Thanks,
Nathan
11-21-2014 01:27 PM
Hello Nathan,
Thank you for your question regarding .NET. I am just wondering if you can elaborate on your question and/or post a screenshot of your code so that we can better assist you.
11-21-2014 01:30 PM
I was referring to the OP's answer in message 2, which has a screenshot including a specific .NET refnum constant. How did he get it? I have a temporary workaround where I make a .NET DLL with the desired refnum type as an output, from which I simply create a constant. If there is a way of specifying the type by string, that would be a little cleaner, as much as I relish the oppurtunity to pull up Visual Studio 🙂
11-24-2014 02:31 PM
Hello Nathan,
Thank you for clarifying. You can create a list using an enum, then you can convert the output of the enum to a string and use that as the constant for the .NET refnum. You can find this here: Enum to String. You would be replacing the string constant in the sample OP provided with that conversion (that results in a string constant as defined by the enum. Please let me know if this helps answer your question.
02-13-2015 12:51 PM
I know that this thread is quite old but it was helpful for my application. I think the issue Garousi was having, and myself as well with the null pointer exception, is that the example has a space in between List` 1 where it should be List`1. Once I found that, the example worked like a charm.
So:
System.Collections.Generic.List` 1[System.String]
should be:
System.Collections.Generic.List`1[System.String]
You can populate the .NET list using the add or insert methods in the invoke node.
Thanks for your solution to this Jim_Kring.
04-10-2016 04:31 AM
Could you please tell me how to get To More Specific Class .NET reference (System.Collections.Generic.List`1[System.String])? I got every piece except that.
04-11-2016 05:43 PM
Are you referring to the .NET reference wired into the top of the To More Specific Class function?
12-15-2016 06:56 AM
I guess he does... me having the same question
02-08-2018 07:54 AM
I've been trying for ages to work out how to create an instance of an Enumerable list for use when defining the pipeline for a MongoDB aggregation (basically a list of BSON documents, which specify the operation in each stage in the aggregation).
This solved my problem.
Great stuff!.
02-08-2018 09:31 AM
I've just realised that you can do this too...
For some reason I'd always overlooked this VI, but it seems pretty powerful.