Grasshopper

algorithmic modeling for Rhino

load definition bootstrap and override error/warning messages?

Dear reader,

I would like to perform a check on the definition during definition load before our GH components are "loaded" (preferably only when it contains them). To me it seems similar to GH_AssemblyPriority.PriorityLoad but instead executed every time a definition is loaded.

I understood that the components (addon) are loaded during grasshopper startup. So that might be a problem for the approach I'm looking for. Maybe there is a construction on addon level similar to OnLoad event (html/javascript).

The main goal is that we want to handle our custom addon/component version mismatch ourselves if a definition is loaded. Even better: overriding grasshopper's load error/warning dialogue. I'm aware of the component obsolete mechanism but I'm worried about legacy code maintenance as I have discussed in another topic. I rather instruct the user to switch between addon releases with an interactive script or something.

Regards, Wei Pien

Views: 332

Replies to This Discussion

That will be almost certainly impossible. You can load specific GHAs through code (although you cannot unload them), but you will not be able to do so in between a file being opened and that file failing to load correctly because the required components aren't available.

There are no events or mechanisms that allow you to intervene in a file reading process. Also, what would happen if later another file is loaded that requires a different version?

I can't think of a good solution for what you want. You could make your components empty shells and put all the functionality into separate dlls that you load on demand. Not sure that would actually solve your problem though.

Hi David, thanks for the reply. I understand and I had no high hopes for that but just wanted to be sure. For now I'll use the BeforeSolve method which will suffice for most of the cases. Regards, Wei Pien

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