Good morning,
This is in reference to an issue I am currently working on for the following post:
Reconnect tap connectors after disconnect from external event
Basically, from what I understand about connector behavior at the moment, when you place a tap or otherwise manually connect one part to another, a connector is added to the host part, if it doesn't already exist in the family, with an id = part max connector id + 1.
When Connector.DisconnectoFrom() is called, the connector that was automatically inserted gets deleted, and any references to it become invalid. Therefore, it is impossible to reconnect directly through the connectors themselves.
I am going to attempt impersonating a mouse click/drag to mimic what happens when a user clicks the tap connector and drags it close to another part - it snaps back in place and the missing id is recreated (assuming there is only one tap - disconnect may reduce all other extra ids by one, i have not verified that yet, that could complicate the problem further, though a workaround for that would be to save off the max connector id beforehand, but if someone is dealing with multiple taps with inserted ids that could be dangerous for integrity purposes).
Still, impersonating the mouse is way more complicated than just disconnect/reconnect.
Having an optional parameter on DisconnectFrom() to allow for preserving the host connector as is would make this process very smooth.
Other applications I could guess might apply to this is any other part connected to the automatic connectors, or say someone wanted to add something between an existing connection - they would run into the connector id issue as well if they tried to connect using connectors alone. I'm sure in some or most cases, the function to place whatever it is would handle the connector insertion (I would hope, anyway).
Just a thought, thanks
Thanks