Grasshopper

algorithmic modeling for Rhino

Retrieving the current Unit System in Rhino space in GH component

Hello guys,

 

I'm trying to develop my own component in GH and need to extract the unit system information of the current Rhino model. 

 

I found the following page but it does not seem to work when I'm writing a plugin for GH because it is only for Rhino.

http://wiki.mcneel.com/developer/sdksamples/unitsystem

In general I just fail to find a way to extract information from the current Rhino doc. I wonder if there is a solution to it.

 

Thank you very much

Views: 2071

Replies to This Discussion

A = doc.GetUnitSystemName(true, true, true, true);

 

 

You can access the current Rhino document using the 

 

Rhino.RhinoDoc.ActiveDoc

 

property, which is a static (Shared in VB) property. Note that when Rhino starts or shuts down, there might not be an active document, so you should check this value for null (Nothing in VB).

 

The example you linked to uses the old SDK, Grasshopper uses the new SDK (called RhinoCommon). RhinoCommon documentation can be found online.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks a lot.  So this and the line Michael had given should return the same value I guess?

Had just quickly tested his version there in C# component, seems returns a string with value "m" (mm, km, etc in other cases I suppose). 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service