Hi @bentraje DESC_MAXEX is only used for the live editing in the GeDialog. And in fact, the Checkbox for Limit Min/Max is only stored and used in the UI. After that, it defines the MIN value either to the entered value or either by the default min/max value the datatype can handle.
So through the API, there is no way to check/uncheck the limit of a UserData in the dialog since they are only managed by the Dialog and since UserData value is always limited (a float have a limit, same for an int... etc)
So you can enable limit by restore theses default value like so. (Of course, as said before it will not change the enable state of the Limit in the UserData Manager)
import c4d
def main():
for id, bc in op.GetUserDataContainer():
print bc[c4d.DESC_MIN]
# The datatype of the user data is the last part of the DescID,
dataType = c4d.GetCustomDataTypeDefault(id[-1].dtype)
# Defines the min value of the description container with the default min value of the datatype
bc[c4d.DESC_MIN] = dataType[c4d.DESC_MIN]
# Sets the User Data new Description
op.SetUserDataContainer(id, bc)
print bc[c4d.DESC_MIN]
c4d.EventAdd()
if __name__=='__main__':
main()
If you have any questions, please let me know.
Cheers,
Maxime.