Show transformable grips without using a command?

My plugin stores some coordinate information (like an origin). Ordinarily I can use GetPoint for this. However if the user wants to move the geometry in a document, there is no way for them to simultaneously alter the coordinate information in the plugin so it stays the same relative to the geometry.

One approach would be to monitor RhinoDoc.BeforeTransformObjects and update the coordinates whenever the user transforms something. But then there is no way to know if the user intended to only transform the objects, or the coordinates as well.

My preferred approach would be to show the coordinates as a virtual grip or handle only under certain circumstances which the user can ctrl+click to transform together with the other objects. So far I’ve found CustomObjectGrips, but that requires a specific RhinoObject to which to attach the grips, which doesn’t necessarily exist in my case, and it also requires a command, which I also don’t want to have. Essentially I want to have something like a DisplayConduit which is also selectable and transformable like a normal object. Is there any way to do this?

Hi @Max_Eskin,

How are you storing your coordinate information? If you are storing it as custom UserData, then all you need to do is override the OnTransform virtual function and apply the transformation, passed to the method, to your data.

I’ve attached a quick and dirty sample to demonstrate.

TestMax.cs (5.3 KB)

Let me know if you have questions.

– Dale

I saw UserData but the problem as I said is that there isn’t a specific Rhino object that my data is attached to. Essentially there is an origin relative to which the geometry is evaluated, and if the geometry is moved I would like to also easily be able to move the origin, but not always.