algorithmic modeling for Rhino
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
Tags:
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.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by