generative modeling for Rhino
Is there a class to call up the Document Properties? For example the definition file name? i.e. MyFile.gh
Or further the text that can be entered into the 'Description' section of the Definition under the Menu/Window/Document Properties? I can't seem to see it in the SDK documentation.
Something similar to the following that would return information about the current file:
Dim doc As RhinoDoc = RhinoDoc.ActiveDoc...
something as simple as this will do:
GH_Document gd = owner.OnPingDocument();
A = gd.Properties.Description;
I hope this helps,
Exactly what I was after. I must admit I'm having trouble finding my way around the Grasshopper SKD - although I'm quite sure that has to do with the 'learning' curve I'm trying to push through.
Is there a similar method to call what version of Grasshopper is installed?
Versioning is not part of the GH_Document, but you can get both the build-date and the version through the Global_Proc module (I know, horrible name):
Edit: screw it, I just did change those. Methods, constants and properties that used to be in Grasshopper.Global_Proc are now divided into Grasshopper.Tracing, Grasshopper.Versioning and Grasshopper.Utility.
Unfortunately these are modules, not classes so method names will conflict between them, which means I cannot keep the old Global_Proc around and hide it from intellisense, which is the usual technique used to prevent SDK breaks.
From C#, and in IL, vb.net modules are just sealed classes with static methods that are marked with Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute. So users will be able to pick them in C#. One alternative might be to create a look-alike class in Vb.Net?
You're right, since I'm breaking this anyway I might as well dump modules altogether and make something which is easier to modify later on without breaking.
Thanks for your input guys.