Hello @dunhou,
Thank you for reaching out to us. The script is working fine for me. Could you please describe more precisely what is not working for you?
@m_adam was a bit thin-lipped in his example, the example requires the user to select the object to unwrap. I have added a more verbose variant at the end of my posting.
Cheers,
Ferdinand
The result:

The code:
"""Unwraps the active polygon object with MCOMMAND_AUTOMATICUV.
"""
import c4d
# Main function
def main():
"""
"""
# Bail when there is either no selection or the selection is not a polygon object.
if not isinstance(op, c4d.PolygonObject):
return c4d.gui.MessageDialog("Please select a polygon object to unwrap.")
# Run MCOMMAND_AUTOMATICUV
settings = c4d.BaseContainer()
settings[c4d.MDATA_AUTOMATICUV_TAGINDEX] = 0
settings[c4d.MDATA_AUTOMATICUV_FORCESEAMS] = False
settings[c4d.MDATA_AUTOMATICUV_OVERLAPMIRRORED] = False
settings[c4d.MDATA_AUTOMATICUV_OVERLAPIDENTICAL] = False
settings[c4d.MDATA_AUTOMATICUV_SPACING] = 0.01
settings[c4d.MDATA_AUTOMATICUV_USENORMALS] = True
settings[c4d.MDATA_AUTOMATICUV_SPACINGASPECT] = 1.0
res = c4d.utils.SendModelingCommand(command=1053624,
list=[op],
mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
bc=settings,
doc=doc)
# Push an update even to Cinema 4D.
c4d.EventAdd()
# Execute main()
if __name__=='__main__':
main()