Grasshopper

algorithmic modeling for Rhino

(Python) detecting selection event or Gumball on/off event?

Hi, all Python users!

Is there an anyway to detect "selection event" or "Gumball on/off event", then convert this event to bool (true/false)?

Views: 585

Replies to This Discussion

Hi YJ

I'm not an expert on the Gumball implementation, but could you please explain exactly when you would like this boolean value to be returned?

Do I understand that, during solution, if the Gumball is on, you want the have true from a component?
Thanks

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi, Giulio,

Yes, I could get a boolean by using "RhinoObject.IsSelected".

Currently, I am trying to code a kind of interactive spring simulation, moving actual points in Rhino either using "rhinoscriptsyntax" in Python or using "Rhino.RhinoDoc.ActiveDoc.Objects.Transform" in rhinocommon.

The problem was when I use '20ms' Interval, selecting a point, then moving the point was not possible in this short Interval (using longer Interval is working, but loosing simulation speed), so this boolean from selection event helps to pause the simulation.

Now, the code is kind of working, but when I go further from the code (adding another codes with this code), there seems kind of lags. Is there a way that I can solve this issue? Please, see the attached files. Thanks!!

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service