Don't give up hope on iLogic yet. Most things that can be done through VBA can also be done using Inventor's iLogic (which uses VB.NET), they just use slightly different code variations, both based on Visual Basic.
There are ways to get which options are exposed/available when working with Inventor's Translator Add-ins. They can be used through either VBA or iLogic (or even other programming languages).
Here is an iLogic rule I wrote at some point that will create a new text file, and write out all available info about each of Inventor's translator add-ins, and what options they have available. It also writes whatever the default or current values for those options are too. Usually when you see either the Value of 0 (zero) or 1 (one), it means 0 = False and 1 = True, instead of using the terms "True" or "False" directly.
I have some lines commented out, because they were either annoying or troublesome for some reason.
And the end of the code, I chose to comment out the lines (for reference) where it would normally save and close that text document, then relaunch it to show you the result. This way it simply stays open.
Here it that iLogic rule:
Sub Main
'Text file FullFileName (with path & extension)
'where you want it to create the new text file to write this into
oTxtFileName = "C:\Temp\Translator Add-In Options.txt"
oWrite = System.IO.File.CreateText(oTxtFileName)
Dim oTO As TransientObjects = ThisApplication.TransientObjects
Dim oSourceObject As Object = ThisApplication.ActiveDocument
Dim oContext As TranslationContext = oTO.CreateTranslationContext
oContext.Type = IOMechanismEnum.kDataDropIOMechanism
Dim oOptions As NameValueMap = oTO.CreateNameValueMap
Dim oAddIns As ApplicationAddIns = ThisApplication.ApplicationAddIns
For Each oAddIn As ApplicationAddIn In oAddIns
If oAddIn.AddInType = ApplicationAddInTypeEnum.kTranslationApplicationAddIn Then
Dim oTransAddIn As TranslatorAddIn = oAddIn
oTransAddIn.Activate
' Check if the translator has 'SaveCopyAs' options
Try
If oTransAddIn.HasSaveCopyAsOptions(oSourceObject, oContext, oOptions) = True Then
oWrite.WriteLine("")
oWrite.WriteLine("")
oWrite.WriteLine("Translator AddIn Information:")
oWrite.WriteLine("DisplayName = " & oTransAddIn.DisplayName)
oWrite.WriteLine("ShortDisplayName = " & oTransAddIn.ShortDisplayName)
oWrite.WriteLine("Description = " & oTransAddIn.Description)
' oWrite.WriteLine("ClassIdString = " & oTransAddIn.ClassIdString)
' oWrite.WriteLine("ClientId = " & oTransAddIn.ClientId)
' oWrite.WriteLine("DataVersion = " & oTransAddIn.DataVersion)
' oWrite.WriteLine("Hidden = " & oTransAddIn.Hidden.ToString)
' oWrite.WriteLine("LicenseStatus = " & oTransAddIn.LicenseStatus.ToString)
oWrite.WriteLine("LoadAutomatically = " & oTransAddIn.LoadAutomatically)
If oTransAddIn.LoadAutomatically = True Then
oWrite.WriteLine("LoadBehavior (load time) = " & oTransAddIn.LoadBehavior.ToString)
End If
oWrite.WriteLine("DLL FullFileName = " & oTransAddIn.Location)
' oWrite.WriteLine("ProgId = " & oTransAddIn.ProgId)
' oWrite.WriteLine("UserInterfaceVersion = " & oTransAddIn.UserInterfaceVersion.ToString)
' oWrite.WriteLine("UserUnloadable = " & oTransAddIn.UserUnloadable.ToString)
oWrite.WriteLine("")
oWrite.WriteLine("Options: (Name & = & Value)")
For i As Integer = 1 To oOptions.Count - 1
oWrite.WriteLine(oOptions.Name(i) & " = " & oOptions.Value(oOptions.Name(i)))
Next
Else
MsgBox("The TranslatorAddIn Named '" & oTransAddIn.DisplayName & "' doesn't have SaveCopyAs Options.",,"")
End If
Catch
'MsgBox("Failed to write out information about a Translator Add-in.",,"")
End Try
Else
'MsgBox("The AddIn named " & oAddIn.DisplayName & " was not a Translation AddIn.",,"")
End If
Next
' oWrite.Close
'open the file
' ThisDoc.Launch(oTxtFileName)
End Sub
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 have time, please... Vote For My IDEAS 💡or you can Explore My CONTRIBUTIONS
Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)