generative modeling for Rhino
Private Sub RunScript(ByVal vp As String, ByRef A As Object)
Dim view As Rhino.Display.RhinoView = doc.Views.Find(vp, True)
If (view Is Nothing) Then
Throw New Exception("View " & vp & " does not exist")
Dim pts As Point3d() = view.MainViewport.GetNearRect()
If (pts Is Nothing) Then
Throw New Exception("View " & vp & " is not valid")
Dim rec As New Polyline()
A = rec
Hi,David, Thanks for your reply ,But I have another question,would you please tell me what's wrong?
you defined the new rectangle As a PolyLine (i.e. Dim rec As New Polyline())
But I defined the rectangle as a Rectangle.what's the difference between them?
there is no wrong message when the grasshopper VB runs,but As long As assigned the rectangle to the output, i cannot find it in the viewport anywhere.
what's wrong with that?
Dim w ,h As Double
w = ptA.DistanceTo(ptB)
h = ptA.DistanceTo(ptD)
Dim Rtg As New rectangle3d(plane.WorldXY, w, h)
Dim v As New Vector3d((PtA.X - Rtg.Corner(0).X), (PtA.Y - Rtg.Corner(0).Y), (PtA.Z - Rtg.Corner(0).Z))
A = Rtg
Hi David! Is there any place where is explained how to use the Display Conduit. I found this page on the wiki (http://wiki.mcneel.com/developer/displayconduit) but I do not have clear what to do once I have my own class. I bet I need to register it in some way, but how?
Could you put some on light on these? Thanks in advance.
Already solved!!! As easy as register the correct events .....
This network is a real treasure. Tons of pieces of info spreaded all around that at the end of a couple of days reading become a solution to the problem.....
My HUD display is now almost working....
I get an error when I try to run the script, both in Rhino and Grasshopper.
I want to use this to be able to render a view, then make2d and place the vector lines over the rendered image, having the viewport boundary as vectore lines would really speed up the process of placing the lines correctly. For some reason make2d doesn't offer to draw the viewport border, like "export to illustrator" does. I would just use export to illustrator if it had a "hidden line" option. You can't have it all! :P