Grasshopper

algorithmic modeling for Rhino

VB Code works differently in VS and GH VB Script Component.

Hi,

I used VS to make GH Component.

This Code will Export Data from GH to Excel.

What odd is...

I used first this code

            For i As Integer = 0 To inputT.Branches.Count - 1
                For j As Integer = 0 To inputT.Branch(i).Count - 1
                    Dim cell As Object
                    cell = ws.Cells(i + 1, j + 1)
                    cell.Value = inputT.Branch(i)(j)
                Next
            Next


after Build shows my GH Component this error message

1. Solution exception:Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

If I convert the data to String.

cell.Value = Convert.ToString(inputT.Branch(i)(j))

It works fine.

What I can't understood is...

I tried same code with VB Script Component in GH.

then it works without Converting!

What is difference between VS Work Environment and VB Script Component??

(I used .net 3.5 setting in VS for Compile)

There is two full Codes one for VS VB and one for VB in GH in Attachment.

Can somebody explain the reason of this problem?

Views: 215

Attachments:

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service