GrasshopperPlayer command asking for same input twice!

I’m creating a GrasshopperPlayer definition. And for some reason, the input angle gets asked twice, but there is only one unique input for angle.

The order of execution is perfect, so no issues there. Have had this issue with several other definitions, so must be something I’m doing wrong.

Command line asks twice:

Short video:

Inputs:

Oh shoot, I found the issue. I had 90 input values. Right click Get Number —> set At Most to 1.

This doesn’t actually solve it, I have a similar set-up, even if I set ‘at most’ to one, the output is still duplicated

Any recommendations?

(Moved from another topic)

Hi,

I’ve encountered the same issue but with the ‘get geometry’ from grasshopper.

It’s a simple script, works fine when I am running directly from the Grasshopper interface, but when running through Grasshopper player it runs twice.

and by twice I mean first
image

second time
image

ETA: This post (and the previous one and next 8) were moved from another topic (Python script runs twice - #7), because it was not the same issue as in that other topic, which was 100% a python script issue and not a GrasshopperPlayer or RhinoInside Revit issue.

Hi @diana.ofcg, do you have a python script in your grasshopper file? If not, then this is not the same issue.

In that case, it would be better to open a new thread describing what you are trying to accomplish, the problem you are experiencing, and including your grasshopper definition so others can look into it and help you more easily.

(Moved from another topic)

Hi Pierre,

I am actually having this issue with a script but also as per my previous example.

Here’s a preview of what’s hapenning once I am baking into Revit

And here is the file
Duplication Issue.gh (13.9 KB)

I cannot figure out why the object is baking twice in Revit, I’d appreciate any help I can get. I have been seeing a few similar posts with no obvious solution.

Diana

Similar issues here, any thoughts?

https://discourse.mcneel.com/t/python-script-runs-twice/166230/9?u=diana.ofcg

(Moved from another topic)

Thanks Diana. Just to confirm, the twice baking or twice running only occurs in Grasshopper Player?

(Moved from another topic)

Twice baking it seems, although I’m not sure how to tell. I have this also hapenning when I use the ‘Get Geometry’ command without the python script. It seems it’s the baking that is the issue.

(Moved from another topic)

I’ve taken a look. I didn’t install Rhino.Inside for AutoDesk. The only script component I found, is a Rhino 7 C# component, and I don’t know if those are different to Python ones or not.

If I were to take a guess based on general Grasshopper experience, the most likely explanation is the .gh file does the same thing when it is first opened either in Grasshopper Player or in Grasshopper (that maybe has gone unnoticed), that it also does when activated in GH (e.g. toggling a boolean, if the boolean is set to True, and then the definition saved).

Human UI can do some clever stuff. I don’t know if it can do background listeners, but perhaps it’s theoretically possible if remote that something changes in the Grasshopper Player environment, that causes one of the outputs from the first execution of the script, to raise an event that a listener reacts to, and triggers the script again (in such a way that it executes twice only, not in an infinite loop).

There’re a lot of moving parts in that file overall. Try disabling parts of it until the fewest ones necessary to cause it to run twice is isolated.

(Moved from another topic)

I actually managed to do a human ui script that doesn’t duplicate, but my issue for this senario is that I want to create a rhino button that runs a grasshopper player script to select objects from rhino and bake them into Revit.

My previous example should be the most simple

Here I am only using the Grasshopper ‘Get Geometry’ command, yet this is giving the same issues as demonstrated in the python script (video) example.

Just to clarify, in this example I am not using Human UI.

(Moved from another topic)

I need a much simpler example to debug it via the forum if I can’t be there in person, I’m afraid.

It’s never a bad idea to separate creation of the rhino button from the grasshopper player script it runs.

The actual code in the script too, can be made idempotent.

It’s also possible, that some of the baked objects, are being selected by the same thing that selected the initial objects to bake.

I’d also make sure the user isn’t just pressing the button twice.

That’s all I can think of for now.

(Moved from another topic)

Here is a simple test

Example 01:
I am running this within the grasshopper environment, which seems to be working fine and is not duplicating the geometry when baking, that’s great.

Example 02:

Here I am running the Grasshopper script through the player and attached it to a button like this
-GrasshopperPlayer “file path.gh”

The problem is that it’s baking it once when I press enter the first time, but then it comes up with the second menue with this

image

and this (undo) option is what it’s causing it to bake a second time.

How can I avoid that from hapenning?

I can open another ticket with this info if it doesn’t derail this ticket so much.

(Moved from another topic)

Thanks for uploading those videos, but I can’t tell what’s what in them. I’ve not come across that undo option before, but I’ve not used GrasshopperPlayer.

I am having a similar issue here -

Here is a simple test

Example 01:

I am running this within the grasshopper environment, which seems to be working fine and is not duplicating the geometry when baking, that’s great.

Example 02:

Here I am running the Grasshopper script through the player and attached it to a button like this
-GrasshopperPlayer “file path.gh”

The problem is that it’s baking it once when I press enter the first time, but then it comes up with the second menue with this

image

and this (undo) option is what it’s causing it to bake a second time.

How can I avoid that from hapenning?

Hi @diana.ofcg,

Thanks for reporting.
There will be a fix for this on 8.19 that will released 8th April.

Hello Kike, I am running into the same issue as well, & similar to Diana I am using it on Rhino.Inside.

here are the versions if it helps

image