algorithmic modeling for Rhino
Hi
It seems that the command GrasshopperUnloadPlugin does not actually clear all the resources related to Grasshopper and the custom gha's.
I discovered this when I noticed that event handlers (created by my gha) in the previous run of Grasshopper are still active after Grasshopper is unloaded and loaded again.
Closing Rhino will, however, clear all of the event handlers (unsurprisingly)
Is this behavior normal?
Is it possible to to force Rhino to completely clear all the gha data when Grasshopper is unloaded?
Bests
Long
Tags:
Thanks for sharing your thoughts :)
"When I wrote an separate .dll I noticed that I cannot update the .dll without closing rhino"
I notice the same behavior with the separate dll too. This is the typical behavior when any dll is loaded (in other programs too, not just Rhino/Grasshopper). This is because the host software (i.e. Grasshopper) is currently using the file.
The reason why the gha file can be updated/overwritten was because, by default, Grasshopper (sort of) copy the gha into the memory first and loads it from the memory.
If you go to the GrasshopperDeveloperSettings and turn off "Memory load GHA assemblies using COFF byte arrays" then the gha will be load directly from the hard drive like a normal dll. This will consequentially prevents the gha to be updated/overwritten (e.g. by Visual Studio)
"I think you can also unregister before you register. This will destroy an still existing event the next time you start gh..."
Yes I am considering this strategy too. I believe it will do the trick :)
"There is probably an event which is fired when grasshopper is closed"
Officially there is no event invoked when Grasshopper is unloaded (I asked David Rutten about this a while ago). But I guess we can more or less use the OnCanvasDestroyed event to achieve similar result in this case.
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by