Thanks a lot. i have already figure it out.
import c4d
from c4d import gui
obj = op.GetObject()
UD = obj.GetUserDataContainer()
def main():
mode = 1
randomPoint = 2
Field = 3
for descId, container in UD:
theID = descId[1].id
if theID == randomPoint:
if obj[c4d.ID_USERDATA, mode] == 0:
container[c4d.DESC_HIDE] = False
obj.SetUserDataContainer(descId, container)
if obj[c4d.ID_USERDATA, mode] == 1:
container[c4d.DESC_HIDE] = True
obj.SetUserDataContainer(descId, container)
if theID == Field:
if obj[c4d.ID_USERDATA, mode] == 1:
container[c4d.DESC_HIDE] = False
obj.SetUserDataContainer(descId, container)
if obj[c4d.ID_USERDATA, mode] == 0:
container[c4d.DESC_HIDE] = True
obj.SetUserDataContainer(descId, container)