algorithmic modeling for Rhino
Is there any way to recompute custom code section in VB component ?
So the real problem behind this question is : when I use close button on my form, it wont reload cause it is declared in custom code section which wont recompute with owner.expiresolution(true). Am I missing something ? I cannot declare buttons and form and all that stuff in run script, cause it doesnt accept withevents property. My idea is to recompute all the script component stuff...
This is my code :
Private Sub RunScript(ByVal x As Object, ByVal y As Object, ByRef A As Object)
If x = True Then
frm.Controls.Add(b1)
t1.location = p0
frm.Controls.add(t1)
frm.show
a = zmienna
Else
frm.Dispose
End If
End Sub
'<Custom additional code>
Dim frm As New system.windows.Forms.Form
WithEvents b1 As New system.Windows.Forms.Button
WithEvents t1 As New system.Windows.Forms.TextBox
Dim p0 As New system.Drawing.Point(30, 30)
Dim zmienna As String
Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.click
zmienna = t1.Text
owner.ExpireSolution(True)
End Sub
Tags:
ok, problem solved :
Private Sub RunScript(ByVal x As Object, ByVal y As Object, ByRef A As Object)
If x = True Then
frm.MinimizeBox = False
frm.MaximizeBox = False
frm.Controls.Add(b1)
t1.location = p0
frm.Controls.add(t1)
frm.show
a = zmienna
Else
frm.hide
End IfEnd Sub
'<Custom additional code>
WithEvents frm As New system.windows.Forms.FormPrivate Sub Form1_FormClosed(sender As Object, e As windows.Forms.FormClosingEventArgs) _
Handles frm.FormClosing
e.Cancel = True
End SubWithEvents b1 As New system.Windows.Forms.Button
WithEvents t1 As New system.Windows.Forms.TextBox
Dim p0 As New system.Drawing.Point(30, 30)
Dim zmienna As StringPrivate Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.click
zmienna = t1.Text
owner.ExpireSolution(True)
End Sub
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
© 2025 Created by Scott Davidson.
Powered by