@JBerns
Alright, I’ll try to explain this to you. You’re right that your .dll add-in should have a new GUID so that Inventor can recognize it. Other add-ins work in a similar way — each has its own GUID that Inventor needs to identify. You need to remember that when referring to an add-in, you must provide its GUID, not the GUID of your own add-in. That’s why, if you want to refer to:
iLogicAddin = ThisApplication.ApplicationAddIns.ItemById(
"{26A9A051-ACB3-436D-925C-4825072FB651}")
you need to provide the correct GUID for that add-in, which for iLogic is: {3BDD8D79-2179-4B11-8A5A-257B1C0263AC}
To check the GUIDs of individual add-ins in Inventor, you can use this code to display all add-in GUIDs in the log.
Sub main
Dim addins As ApplicationAddIns = ThisApplication.ApplicationAddIns
For Each addin As ApplicationAddIn In addins
Logger.Info(addin.DisplayName & " - " & addin.ClassIdString)
Next
End Sub
To sum up, for your code to work correctly, it should look like this:
Sub Main()
If (IO.File.Exists(outputFile)) Then
IO.File.Delete(outputFile)
End If
searchText = InputBox("Text to search for", "Search")
iLogicAddin = ThisApplication.ApplicationAddIns.ItemById(
"{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}")
iLogicAutomation = iLogicAddin.Automation
Dim doc As AssemblyDocument = ThisDoc.Document
SearchDoc(doc)
For Each refDoc As Document In doc.AllReferencedDocuments
SearchDoc(refDoc)
Next
Process.Start("notepad.exe", outputFile)
End Sub
If you found it helpful, a "Like" would be much appreciated!
If this post solved your problem, please mark it as "Solution.".