Detecting changes to component connections in document

I’m trying to find an event handler which runs whenever a copmonent is added/deleted, or its inputs get changed. Currently I have found GH_Document.ObjectsAddedEventHandler and ObjectsDeleted. I am still missing events when a connection between components is created and deleted,

Thanks in advance


I’m learning about all this currently. I suspect you might be looking for the GH_DocumentObject.OnObjectChanged method. Documentation.

There is the GH_ObjectEventType enumerator for the event types if you want to control it. Documentation.

As I understand… these are both inherited by the GH_Component class itself. Documentation
One of the Method members on GH_Component is the OnObjectChanged()

1 Like

Hi D.Ronald. I’m also trying to let the component run some functions only when it detects changes in the input. However, I am a bit confused that The GH_DocumentObject.OnObjectChanged method has to be called somewhere to raise the event “GH_DocumentObject.ObjectChanged”. I thought it should be called automatically when any change occurs in the input, but actually it does not. Anyway could we find the EventHandler that link to the changes in the input? :slight_smile: