Rhinoscript VB issues with data types


#1

Hello,

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”)


(Dale Fugier) #2

Hi @Jed,

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

– Dale


#3

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


(Dale Fugier) #4

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


#5

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


(Dale Fugier) #6

Hi @Jed,

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

– Dale


#7

Thank you Dale! Glad I am not going crazy haha