Solved Create object with custom icon in Python

Hi,
I'm trying to write a python script to create a Null with a custom icon (with the same icon ID of the PBR light, just for test)
but I cannot modify the icon.
it give me no error so I don't know what's wrong

thanks

nul = c4d.BaseObject(c4d.Onull)
nul.SetName('New Test Icon')
doc.InsertObject(nul)
    
nul[c4d.ID_BASELIST_ICON_FILE] = 1021433
c4d.EventAdd()

Found it

I think it needs a string not an int

nul = c4d.BaseObject(c4d.Onull)
nul.SetName('New Test Icon')
doc.InsertObject(nul)
    
nul[c4d.ID_BASELIST_ICON_FILE] = "1021433"
c4d.EventAdd()

Found it

I think it needs a string not an int

nul = c4d.BaseObject(c4d.Onull)
nul.SetName('New Test Icon')
doc.InsertObject(nul)
    
nul[c4d.ID_BASELIST_ICON_FILE] = "1021433"
c4d.EventAdd()

hello,

good you found out how to resolve your issue,

for you next thread, please mark your thread as a question as follow

Cheers
Manuel

MAXON SDK Specialist

MAXON Registered Developer