How to handle new samples/object before it has finished creating

Hi,

I am developing a script in dynamic plugin to assign a property value by default when a new object is created, the new object should also have this default property value that it being assigned by the script.

So, the concept is, I have a property ty counter(integer) and I want my object type to have this property and assigned by default when the new object is created. When a new object is created, my script run in behind and seeing the permid of existing sample on this colleciton/experiment and can assign the counter values. however, this new object has a empty value as the object has not been created yet. so to give this new object a counter value, I have to re run the script again. I do not want to do that. I want the new object to have a default counter value when the new object is created.

Or is there any way to trigger a save in another script. for example, while creating an object, how to trigger a save into the collection/experiment. inside or outside dynamic property plugin.

How can I solve this problem?

TIA :slight_smile: