Here is a bit of example code to get you started, in case you are not familiar with how to use what I mentioned. It starts by getting the main assembly. Then it gets the 'ClientId' of the Tube & Pipe AddIn (or you could just replace that bit of code with a single String type variable, and assign it the hard coded ClientId). Then it loops through your components, checking if each one represents an assembly or not. If not, it skips to next component. When the component represents an assembly, it then gets the document that the component represents. Then it checks that document's 'interests' to see if the Tube & Pipe AddIn has an 'interest' in it. If it finds any, it shows a message with that components name in it. You can change that part however you need to, because this is just an example of how to check that property.
oADoc = ThisAssembly.Document
Dim oClientID As String
For Each oAd As ApplicationAddIn In ThisApplication.ApplicationAddIns
If oAd.DisplayName = "Routed Systems: Tube & Pipe" Then
oClientID = oAd.ClientId
End If
Next
If String.IsNullOrEmpty(oClientID) Then
MsgBox("Did not find ClientId of Tube & Pipe AddIn. Exiting rule.", , "")
Exit Sub
End If
oOccs = oADoc.ComponentDefinition.Occurrences
For Each oOcc As ComponentOccurrence In oOccs
'if it's not an assembly, skip to next component
If oOcc.DefinitionDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Continue For
'get document
Dim oOccDoc As Document = oOcc.ReferencedDocumentDescriptor.ReferencedDocument
'check if Tube & Pipe has 'interest' in this document
If oOccDoc.DocumentInterests.HasInterest(oClientID) Then
'found it
MsgBox("The Tube & Pipe AddIn has an 'interest' in the component named " & oOcc.Name, vbInformation, "iLogic")
End If
Next
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡 or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)