Object DOF

is it possible to constrain the DOF (degrees of freedom) of an object in rhino using RhinoCommon?

Hi @reuben.alfred,

Well, you can lock an object or the layer it’s on. Other than that, you might consider just drawing the object, dynamically, using a display conduit. The downside of this is that you don’t able to pick it.

– Dale

Hi Dale,

Thanks for that.

What I meant was to make an object translatable only in a given direction.

Hi @reuben.alfred,

There is no way to restrict the location or orientation of objects that are in the document. Like I mentioned above, the only way you can do this is to not add it to the document but to just draw it using a display conduit. This is how Grasshopper works, if you need an example.

– Dale

what I was wondering was something like this:

public class MyObject: <RhinoObject derived class>
{
	.
	.
	public override void OnTransform(Transform  t)
	{
	    // if direction resticted then adjust the matrix 
	}

	.
	.
}

OK, it looks like that all RhinoObject derivatives have private constructors :frowning:

Just realized what you meant! Sorry Dale! if an object in the doc is restricted then it will mess up global transformation such as when the user rotates using the mouse, etc.