Sure. All you need to do is to extend the constraints input to include the specific coordinates (x,y,z or all). The gradients for the relevant coordinates have to be zeroed out inside the code. Let me know if you are interested in coding this up and I'll send you more details.