# Mouse Pick Positions and Swap Between Geometry

Hi all,

So I’m looking to build a tool in TD that requires you to pick a position in a window for something to render (in this case a circle, to represent that position), and then be able to swap to another and do the same thing. So essentially, it would be as follows:

Click/drag and “stick” circle to that position → Swap to next circle (via button, etc) → Click and drag, etc

This would be for a finite number of circles, so I was trying to do this with Python, and it worked, but I’m not actually able to see the circle move to that position, although the code says that is changing based on the print out. Tried using a while statement, but as I expected it crashed when I did so. Hopefully this makes sense, and I appreciate the help!

Here’s the code:

``````currentX = op('null1')[0]
currentZ = op('null1')[1]
pos1X = op('geo1').par.tx
pos1Z = op('geo1').par.tz
pos2X = op('geo2').par.tx
pos2Z = op('geo2').par.tz
pos3X = op('geo3').par.tx
pos3Z = op('geo3').par.tz

def onValueChange(channel, sampleIndex, val, prev):
if(val == 0):
pos1x = currentX
pos1Z = currentZ
print(pos1x)
print(pos1Z)
elif(val == 1):
pos2x = currentX
pos2Z = currentZ
print(pos2x)
print(pos2Z)
elif(val == 2):
pos3x = currentX
pos3Z = currentZ
print(pos3x)
print(pos3Z)
return

``````