Using Visual Basic 2008 Express dialog form in Ruby.
-
I'm curious?
Does that mean that Grasshopper VB.net code samples can run under Ruby? -
Hi tomot,
May I know that where I can get Grasshopper VB.net code samples, please?
I do try to search in this forum but no result. -
Tomot,
Grasshopper uses the Rhino graphics engine and wouldn't run separately. Unless you wish to execute the grasshopper script, let Rhino do the processing and then return the geometry to Sketchup. - Which would be a little silly as there will be easier ways to achieve it.By the way, calling .NET/COM code from SU Ruby has been available since the first release through ole32.
Talking the other way is a different matter. That is why I have asked for a ruby script to be executable through the Sketchup COM API. Initially HQ agreed it was a good idea but for whatever reason the didn't implement it (since last I checked).
Maybe Oscar will be so kind as to let us know how he achieves the bridge. -
@unknownuser said:
Hi tomot,
May I know that where I can get Grasshopper VB.net code samples, please?
I do try to search in this forum but no result.There are no "Grasshopper VB.net code samples: in this forum, but there are here:
http://en.wiki.mcneel.com/default.aspx/McNeel/GrassHopperGallery.html -
@toxicvoxel said:
Maybe Oscar will be so kind as to let us know how he achieves the bridge.
thanks, I'm also just simply, trying to expand my general understanding
-
This is the example ruby script :
def test input = UI.inputbox ["Ruby says"], ["Hello! VB!"], "Make Friend with VB" OscarVB.dialog(File.join(File.dirname(__FILE__),"HelloVB.exe")) OscarVB.execute_script("HelloVB.exe","Label2_text","Ruby says ; " + input[0]) OscarVB.execute_script("HelloVB.exe","TextBox1_text","Hello! RB!") end
The below is the VB.net script :
Public Class Form1
Dim rb As New OscarRB.RubyI use this two ruby script to call and pass parameter to the below VB.net Sub.
OscarVB.execute_script("HelloVB.exe","Label2_text","Ruby says : " + input[0])
OscarVB.execute_script("HelloVB.exe","TextBox1_text","Hello! RB!")Sub Label2_text(ByVal tx As String) Label2.Text = tx End Sub Sub TextBox1_text(ByVal tx As String) TextBox1.Text = tx End Sub
This is the way we start to connect ruby and vb.net. It is a MUST.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load rb.Open(Me) End Sub
Using "End" to Exit the VB.net form.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End End Sub
This is how we execute a ruby script in the VB.net form.
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Leave rb.execute_script(Me, "draw_text", TextBox1.Text) End Sub
End Class
-
There is a Released Version of OscarVB in the first post.
The two bridges are inside the zip file.
And the free version of VB 2008 Express can be download from the Jim post above.
Thank You! -
This is the youtube link. (I do not know how to get the video inside this forum. ) Thank You
[flash=560,340:2jyf8wrk]http://www.youtube.com/v/hGjFK5o9g-I&hl=en&fs=1&[/flash:2jyf8wrk]
This shows the latest version is more stable.
[flash=560,340:2jyf8wrk]http://www.youtube.com/v/ljVn-F7qxqQ&hl=en&fs=1&[/flash:2jyf8wrk]
-
Hi Oscar,
Could you please just share the source code of your VB.net. It will be useful for me
Thanks in advance !!
-
Who just loads up some guys exes and dlls with no source? Geez, just load up the vb project.
Advertisement