please use English for your communication
if i understood correctly your question, you want to implement an undo stack.
This script will help you to understand how it can be done. Please have a look at the documentation for more information.
We also have an undo manual for c++ that could help you to understand how it's working.
The following script will reset the position for each selected object. It will only reset the local position of the object. You could try to improve it using the ctrl key to reset the global position. (you would need to use
GetMg and SetMg instead.
Please read our documentation about matrices. to understand how they work and how you can use them.
from c4d import documents, plugins
# Retrieve all the selected object
objects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_NONE)
# Start a new undo stack
# For each selected object
for obj in objects:
# Retrieve the local Matrix
ml = obj.GetMl()
# Define a new offset vector with the one by default (0, 0, 0)
ml.off = c4d.Vector()
# Add a stem in the undo stack for this object.(sot it previous state will be stored)
# Change the obect's position.'
# Close the stack.