generative modeling for Rhino
David,
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...
Thanks,
/m
Tags:
Permalink Reply by Giulio Piacentino on June 19, 2012 at 2:33am Hi Matthew,
something as simple as this will do:
GH_Document gd = owner.OnPingDocument();
A = gd.Properties.Description;
I hope this helps,
- Giulio
________________
giulio@mcneel.com
Permalink Reply by Matthew McDonnell on June 19, 2012 at 6:00pm Thanks Giulio,
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?
Regards,
/m

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):
Grasshopper.Global_Proc.Version;
Grasshopper.Global_Proc.VersionString;
Grasshopper.Global_Proc.BuildDate;
--
David Rutten
david@mcneel.com
Poprad, Slovakia

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.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Giulio Piacentino on June 20, 2012 at 3:41am 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?
- Giulio
________________
giulio@mcneel.com

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.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Matthew McDonnell on June 20, 2012 at 8:40pm Thanks for your input guys.
/m
Added by David Stasiuk 8 Comments 22 Likes
Added by stefano 5 Comments 8 Likes
© 2013 Created by Scott Davidson.
Powered by