Thank you so much for the help! The script works fine after adding this line.
I tried to export the OBJ file using c4d.documents.SaveDocument(). The return value always be true, but I cannot find the exported file.
I can reproduce this issue using the script from the official repository:
This issue only appears in Cinema 4D R23, and I also found that the API works after I export an OBJ file using GUI. If I reset the user data by deleting the preferences folder, it doesn't work again.
Cinema 4D version: R23.110
System: macOS 11.2.3