Grasshopper

algorithmic modeling for Rhino

Hello. Is it possible to automatically recalculate python component when geometry in rhino document was moved or changed? Also I need to know an id of the object that was moved.

On the picture below I used timer to update all geometry. But it becomes slow with a large number of geometry and components. So I need to update geometry that really needs to be updated. 

Views: 1245

Replies to This Discussion

Good question. Every time I've bumped in to this problem I have solved it with a timer, as you have done above. Would be interesting to know if anyone has found a better solution. Feels like it should be possible to track down the event handler of the specific object if you know the Id..

Hi,

Here's a solution that appears to work. The key idea is to attach a callback function to the AddRhinoObject event.

See: http://discourse.mcneel.com/t/monitor-mouse-event/4481/3

Attachments:

Thank you! It's working and it's great!

As I understood function will be removed from event when you are closing Rhino. Is it right?

Can't you just assign the object to a brep and input that to your Python script with a wire and let Grasshopper issue a recalculation when it changes in the Rhino doc?

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