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.
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!
Sorry, for necrobump of this one though I have a related question which can fit here.
Dear @dale is it possible to know the result of below dialog or i need to ask again on my own for my purposes?
Also i found weird behavior when I will choose Yes (scale model) and use Insert command it seems to be adapted in insertion window i have Uniform 1 1 1 but when i reset the scale of object it seems like original one wasn’t scaled internally but InstanceObject has some xform on it? That’s problematic as original definition didn’t changed on scale action… So if ill use under such conditions Rhino.RhinoDoc.ActiveDoc.Objects.AddInstanceObject it behaves like scaling to the entire doc wouldn’t happen at all …
Adding recording to explain better:
Is this xform hidden under some property to get one ? Tracking it by dev on his own doesn’t make much sense from my pov. I guess this won’t be considered as a bug though it seems like some shortcut here.
Picking Yes to scale the model will trigger a RhinoDoc.DocumentPropertiesChanged event and, if your model has objects, some RhinoDoc.ReplaceRhinoObject events.
Also, an InstanceDefinition object now the unit system of the model from which it came from. The Insert command will look at this unit system and scales a new InstanceObject accordingly so it comes in at the scale the user expects.
Umm ok changing units will fire one DocumentPropertiesChanged and scaling should fire second one? Need to inspect that, though thanks for hint with RhinoDoc.ReplaceRhinoObject i can try to find workaround to find out what user picked.
I imagine that and i realized it’s like that especially for cases with linked blocks though afaik there is no exposed method or property bound to InstanceDefiniton to get that information to prep own xform or get one - i mean i would like to have the same info about it when doing Insert via Rhino.RhinoDoc.ActiveDoc.Objects.AddInstanceObject otherwise I’m ending with objects in the wrong scale.