Setting limit constraints from current transformation values


Is there any way to set the X/Y/Z min and max limit constraints from the current transformation values?
I mean: set rotation of object to 10 degrees -> push some button -> minimum constraint is set to 10 degrees…?

If not, Ill gladly write an addon for this!