Hi @Kantronin,
I'm struggling to understand what exactly you're trying to achieve here. For your further postings please double check our Support Precedures, namely the How To Ask Questions section. Your question is also lacking the scope of question (taking into account you're posting in "General Talk"). Please note, that for the end-user questions we kindly ask you to proceed to our Support Center, where our colleauges can provide you with better support on given topic.
With that's said and as you've mentioned you're using python, I move your posting to the "Cinema 4D SDK" subforum and give you some hints.
I kind of induce that you want to align the global coordinate system with the local coordinate system of your object. However, the way you're saying it that you'd like to move the origin of your document into the origin of your object, confuses me a bit.
You can check the Workplane Modes to set your workplane properly (e.g. lock it to your object ring):
If what you're trying to do is to work with the transformation of your object, please refer to our Matrix Manual, which explains how transformations work for objects in cinema 4d. In this case you can either work with commands utilizing the transformation manipulation of the object, such as
"Reset Transform" if you'd like to move your object to the origin or "Freeze Transform", if you'd like to define the local coordinate system for the object (which is addressed as "relative" in our API). You might be also interested in "Center to ..." group of commands, which offer you a toolset on most common transfomation manipulation actions.
When you'd like to work with bare matrices, I suspect that what you're looking for is the transformation from the global origin into the object's local coordinate system, which would be defined as a global transformation matrix of the object c4d.BaseObject.GetMg():
originToObject: c4d.Matrix = op.GetMg()
or in the opposite direction is the inverse of such matrix:
objectToOrigin: c4d.Matrix = ~op.GetMg()
Cheers,
Ilia