algorithmic modeling for Rhino
Hi all,
saw a few days ago a thread about changing rhino units in GH.
Tried it by myself, just dont know how to adjust them
So far it is like this
The problem es how to set the units with an integer.
The first argument just accepts Rhino.UnitSystem and i cant feed it in like this so i used the values of the unitSystem enumerator and tried to feed them in as an interger.
Anybody an idea?
Thanks!
Tags:
Rhino.UnitSystem is an enumeration, if you know for a fact that your integer value represents a valid value, you can just cast it:
UnitSystem us = (UnitSystem)units;
Similarly, you can also cast the unitsystem value to an int:
int units = (int)UnitSystem;
You don't want to use GetHashCode, that's just for storing data inside HashTables and quick comparison rejections.
Thanks David!
Thats perfect!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by