algorithmic modeling for Rhino
Dear,,,,.
I want to use windows form with Grasshopper... to use many buttons and picturebox to show simulation results using data from grasshopper.
But,...it is not so easy for me. of course it is hard to find example...
I do not know how to load windows form and send data to object in form.vb...using grasshopper sdk.
it is the same,, when I try to use dll(class) with VB component in grasshopper.
may be I have to make two class (class1, form1) but,
when I send data to class1, form1 can not receive class1 data because form 1 made new class1 and both class1, class1(from form1) is different session?
for novice programer,, for me it is very hard.
load class1,
class1 load form1
send data from grasshopper to form1. x
and button click
couldn't calculated,... result was always "0"
and tried many other methods,, but it failed...
may be some known technic but it is hard to find books...
Please...help me.
if possible would you tell me how to load form1 using grasshopper sdk and ""send data "" to form1
or form1 could use data from grasshopper?
Thank you....
for ex)
'(in class.vb)
Public Class Class1
Private Shared fl As Form1
Public Sub fload()
If fl Is Nothing Then
fl = New Form1
fl.Show()
End If
End Sub
End Class
'(in form1.vb)
Public Class Form1
Public x, y As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ab(x, y)
MsgBox("hi" & y)
End Sub
Sub ab(ByRef a As Double, ByRef b As Double)
b = a * 2
End Sub
End Class
'(in Grasshopper VB.component)
Dim cl As ClassLibrary1.Class1
If cl Is Nothing And f = True Then
cl = New Class1
cl.fload()
End If
Dim fr As ClassLibrary1.Form1
If fr Is Nothing Then
fr = New Form1
End If
fr.x = x
a = fr.y
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by