How to set the limitation for the workspace when using transform controller?

Dear All,

As my demo, I set transform controller limitation in scale and translate mode. Objects cannot move out of the workspace.

So there are two issues that occurred.

First, I always check the position to give the limitation. Is that ok? or if there is an alternative way to do it because If the objects are not Geometry(such as an STL object), I cannot set the default size as 50 like the Geometry;

Second, If I rotate the object, it still can rotate the object out of the workspace, how can I check it?
图片