Changing rhino unitsystem

rhino

(Santi Canorestrepo) #1

Hi all,
I am having troubles trying to convert one script from python to c#. I realized that I have to change all of the structure. The code is about units. I would like to have one tool that notify me which units I am using in Rhino. here there are the scripts that I made. Also, I would like to know what the syntax for units in rhino is.


and here is the python script that I want to achieve in c#

thanks in advance for your help.


(Dale Fugier) #2

Hi @santi.canorestrepo,

Let me know if the attached helps.

UnitSystem.gh (4.4 KB)

– Dale


(Santi Canorestrepo) #4

Hi @dale
thank you very much. It was very helpful. Also, I would like to know if there is any way to change the units from Grasshopper to Rhino? and alert me whenever I am not using feet or inches.
thank you Dale!

Santiago.


(Dale Fugier) #5

Hi @santi.canorestrepo,

To modify the Rhino document’s model unit system, use RhinoDoc.AdjustModelUnitSystem.

To be notified when the Rhino document’s model unit system has change, you will need to handle the RhinoDoc.DocumentPropertiesChanged event.

– Dale