Grasshopper

algorithmic modeling for Rhino

Hello all,

I was testing some command line functionality and disabling view port redrawing in a c# component.  After I run the script, I am not able to activate anything on the Grasshopper Canvas.  I can zoom, save the file, etc, but I cannot actually pan or do anything with the mouse clicks on the canvas. I can also add component and hover over inputs, outputs, etc and get tooltips, but no ability to connect components, get into script components, etc.

If I unload GH, and run it again, everything returns to normal.

Here is the script:

private void RunScript(bool go, List<Point3d> pts, ref object A)
  {
    if(go)
    {
      Rhino.Display.RhinoView.EnableDrawing = false;
      foreach(Point3d pt in pts){

        Rhino.RhinoApp.RunScript("_-Point " + pt.X + "," + pt.Y + "," + pt.Z + " ", false);
       
      }
      Rhino.Display.RhinoView.EnableDrawing = true;
    }
  }

Can anyone replicate this?  File is attached below.

Views: 1019

Attachments:

Replies to This Discussion

I can't reproduce it. Canvas works as expected after disabling viewport redraw in my computer.

Ok, thanks for checking...

I can't repeat it either. Is this Rhino4, Rhino5 or both?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Both R5x64 and R4 with GH 0.9.0006.  I have to click through this a few times and then the canvas does what I described above...

hi luis,

did you solve the problem? I reproduced the same behavior of the canvas. Even with this simple line command its the same. Somehow it disables all click events on the canvas.

  private void RunScript(bool run)
  {
    if(run)
      if(RhinoApp.RunScript("!_Line", true))
        RhinoApp.WriteLine("line command done");
  }

Tested on two machines with different Environment R4/R5 x64 GH 9.0014 / 9.0006

No chance to get it properly working. Strange thing is, that on every second run of the script above its working fine...every other its doing the same as you described.

I am seeing the exact same thing.  Freezes the UI every other time I execute a script that includes Rhino.RhinoApp.RunScript().

Update:

I was using the button component to run the script.  I switched that with a true/false toggle, and I am no longer seeing the canvas freeze.  

I am bumping this discussion to see if anyone has found a workaround beyond using the toggle over the button. I have a simple "save" dialog that is causing the canvas to freeze every other time as well.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service