Quote from
erwan on 20 November 2025, 07:20
# Axis index mapping for d.getPosition(CoordMode.Machine)
X = 0
Y = 1
Z = 2
A = 3
B = 4
C = 5
# Read current machine position of all axes
position = d.getPosition(CoordMode.Machine)
spindle_X = position[X]
spindle_Y = position[Y]
spindle_Z = position[Z]
print("Spindle position (machine coords): X={:.3f} Y={:.3f} Z={:.3f}".format(
spindle_X, spindle_Y, spindle_Z
))
chould print the position of your spindel in the chat
here my code for tool change
https://github.com/erwan56450/SimCnC/tree/main/ATC_X_Rack
# Axis index mapping for d.getPosition(CoordMode.Machine)
X = 0
Y = 1
Z = 2
A = 3
B = 4
C = 5
# Read current machine position of all axes
position = d.getPosition(CoordMode.Machine)
spindle_X = position[X]
spindle_Y = position[Y]
spindle_Z = position[Z]
print("Spindle position (machine coords): X={:.3f} Y={:.3f} Z={:.3f}".format(
spindle_X, spindle_Y, spindle_Z
))
chould print the position of your spindel in the chat
here my code for tool change
https://github.com/erwan56450/SimCnC/tree/main/ATC_X_Rack
carbonkid has reacted to this post.