Different Connector return value

Hello guys ,
I have 2 questions
The first , i wrote a script to get the connectors of an element but i want to know how the output connector itself of class (connector) but when i use gettype() method for the connector it gives me of class(connectorset) and the supposed write answer is connectorset
The second question , i use AllRefs property to get the elements that connected tothe connector but the return value of this property is not (element) element but (connectorset) object

The ConnectorSet is essentially just a list of Connectors. Dynamo is automatically casting this to a List upon being output, but its type within Python is still a ConnectorSet. If we output all of the available properties and methods for the ConnectorSet class, we can see that __iter__ is one of them:

meaning that we can use a for loop to access its items:

The AllRefs property returns a ConnectorSet, as shown in the documentation. In order to get the actual host element, you first have to take one of its Connectors, get the ConnectorManager, and then get the Owner (Element).

3 Likes