GhPython Bug/Question




There seems to be weird problem when using Rhinoscriptsyntax.Command from inside a GhPython component in the latest Rhino 6 service release.

I am not 100% sure if its a problem from the code itself or from the component, attached is a simple example.

Pressing the Button, runs the script which basically draws a circle in rhino. After this happens, Grasshopper canvas freezes, everything else seem to be working/selectable (components menu, menu bar etc)

The only thing that seems to get it working properly again is pressing over the Button again, it is the only location clickable on the canvas, which runs the python component again and now everything is back to normal. (7.7 KB)

(Pascal Golay) #2

Hi Sherif - I’m not seeing that here so far, but you might try this

rs.Command("_-Circle “+str(x) + " “+“50”+” _Enter”)

it seems a little cleaner.



Hi Pascal,
changed the code, but that changed nothing with the problem, attached is a short video showing what is happening.bug.rar (1.8 MB)

(Andrew Heumann) #4

This bug has been around for a while (I first complained about it 5 years ago!) - there is some conflict where the Button component itself fails to release the mouse event whenever the script it triggers (can be python, c#, whatever) is interacting with the rhino document.

You will note some workarounds in the below forum posts:

(Giulio Piacentino) #9

Just as a clarification, as @andheum mentions, this is a bug that happens in the interaction of any RhinoApp.RunScript() executions that targets the document and the Grasshopper button itself. I’ve just added a quick port to C# to demonstrate it. (13.0 KB)

(David Rutten) #10

Ach. I thought I fixed this a couple of weeks ago. Apparently not.

(Giulio Piacentino) #11

I reported this issue at RH-40528.