Rhinoscript VB issues with data types


I am trying to use a list in vb. I get an error with this line:

Dim ids As New System.Collections.Generic.List(Of Guid)()

I really want to make a list of strings, but I found this example here:

I have gotten an error any time I try and use ‘As’ statements pretty much, what is the issue here?
(error is “Expected end of statement”)

Hi @Jed,

To convert a Guid to a string, use Guid.ToString().

– Dale

That isn’t the problem. Basic examples that I find for vb online don’t work in rhinoscript for me. For example:

Dim ids As New System.Collections.Generic.List(Of String)()

or even Dim stringValue As String

Hi @Jed,

RhinoScript, which is based on VBScript, and VB.NET are not the same thing. RhinoScript is for scripting. VB.NET is for writing plug-ins using RhinoCommon.

If you are interested in RhinoScript, start here:

If you are interested in writing plug-in with VB.NET (or C#), start here:

– Dale

yikes…is there a recommended way to adding values to an array without knowing the size? Similar to List in c#?

Hi @Jed,

VBScript arrays can be painful. Here are some utility functions you might find helpful.

– Dale

Thank you Dale! Glad I am not going crazy haha