algorithmic modeling for Rhino
Only standalone application have a Main method. I don't understand what you mean by "some function run when the gh file loaded". Obviously, yes. There's a whole bunch of functions that are needed to open, parse, deserialize and load a gh file, but none of them are particularly interesting to anyone except me.
Are you asking about events that are raised when a GH file loads?
Oh sorry, I'm think you are right David.
Is there any such event to be araised when a GH file loads?
The following events may be useful:
The first one is raised when a new document is added to the central list (note: there may be cases where documents are constructed anew or loaded from file outside of the DocumentServer's knowledge).
The second one is raised when a new document becomes active within the Grasshopper canvas, either because it was opened, or because it was switched to.
Also note that both the Canvas and the DocumentServer may be constructed after the gha plugins are loaded, so there's no guarantee that you can register these events during plugin load.
ThanyYou David.
But I Actually don't where to place the event register code of My GHA file.
Sorry. I have got it ,write in the ***info.cs file
,ThankYou
It doesn't matter where the code is that handles these events, the only thing that matters is when you register the handlers. You can only do so after the DocumentServer and or the Canvas have been constructed.
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