I am looking through the Grasshopper API, trying to see how to retrieve the tangle count for clusters.
When you right-click on a cluster, you might see Disentangle (3). The 3 means that there are 3 other clusters that are “tangled” with this cluster. I need to retrieve this number via the Grasshopper API.
If you have a reference to the GH_Cluster, you can get its DocumentId. Then you can get the other GH_Clusters in the GrasshopperDocument that have the same DocumentId.
GH_Cluster c; // presumably you have this already
var documentId = c.DocumentId;
var allClustersForSameDocument = GrasshopperDocument.FindClusters(documentId);
var count = allClustersForSameDocument.Count();