SOLVED Removing objects from InExclude List and GUI (CommandData Plugin)

Hi everyone,

Trying to find a solution to remove objects from a InExclude List from a CommandData plugin.

inExcludeData = self.linkObjs.GetData()
objCount = inExcludeData.GetObjectCount()

for i in range(objCount):
    print inExcludeData.ObjectFromIndex(activeDocument, i)
    print objCount
    inExcludeData.DeleteObject(i)

I can see that that the count goes down and assume the list is being cleared, but the GUI still shows the objects. How can I update it please?
Apologies if this has been solved before, as I couldn't find the thread or answer.

Thank you in advance! ☺

Andre

Hi Andre,

by calling GetData() you receive a copy of the InExcludeData. By writing the changed data back via SetData() it should work as expected.

I turned this thread into a question.

Cheers,
Andreas

Amazing! Thank you again Andreas!