Grasshopper

algorithmic modeling for Rhino

.GetPoint in python component runs twice instead of once

Hi all,

I've created a python component that prompts the user for a point input and then creates a circle at that specific point.

The thing is, I would like the component to run only when I "turn it on", i.e double click the Boolean toggle and change it to true.

It's working, but not as expected. When I change the boolean toggle to True, the user is asked to input a point by clicking. When the user clicks to create a point, he is then asked again to do so, and only then is the circle created. See attached file.

Anyone has a clue why this duplicity is happening?

This may seem a very basic thing, but I can't get it to work properly no matter what I've tried (including while statements and other methods which didn't work).

Thanks,

Yuval

Views: 668

Attachments:

Replies to This Discussion

Hi Yuval,

As I understand it, the code suspends mouse events till the end of the solution.
The first click in Rhino viewport "releases" the mouse and the second actually picks the point.

It looks that this solves the problem of an extra click:

Hi Michael,

This works perfectly - I had a hunch regarding what's happening but couldn't figure it out.

Many Thanks!

Yuval

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service