Grasshopper

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

Views: 111

Reply to This

Replies to This Discussion

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

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

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

Thanks for your input guys.

/m

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service