Grasshopper

algorithmic modeling for Rhino

Hello!

I need to do some extra postprocess after reading a new RhinoDoc or GrassHopper document (only after reading from disk).

For RhinoDoc I have not any problem

 Rhino::RhinoDoc::EndOpenDocument += gcnew EventHandler<Rhino::DocumentOpenEventArgs^>(OnRhinoDocEndOpen);

But for Grasshopper document doesn't exists any GH_Document::OnEndOpenEvent or similar. I have tried with GH_Document::SolutionEndEvent, but this event is launched more times and I can't control who of this callings is the EndOpenDocument.

Thank you very much!

 

Views: 345

Replies to This Discussion

There are DocumentAdded and DocumentRemoved events on the GH_DocumentServer instance that is available from the Grasshopper.Instances class.

Alternatively you could watch for newly loaded documents in the ActiveCanvas (also available via Grasshopper.Instances) and remember which DocumentIds you've already handled this session. That way whenever the DocumentChanged event is raised on GH_Canvas you can do some stuff before the next solution is triggered.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

--

Thank you very much David,

Instances::ActiveCanvas->DocumentChanged += gcnew GH_Canvas::DocumentChangedEventHandler(this, &MyDocumentChanged);

That's what I need.

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