Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have created an iLogic rule that outputs the Translator name and Class ID String to a text file if anyone is interested.
Please excuse the code, as I suspect there are better ways or doing it, but it works for me...
Sub Main
Dim oTextFileName As String = "C:\Temp\Translator AddIn CLSID List.txt"
Dim oAddIns As ApplicationAddIns
oAddIns = ThisApplication.ApplicationAddIns
Dim oTransAddIn As TranslatorAddIn
WritetoFile(oTextFileName, "Autodesk Inventor Translator AddIns Class ID String", False)
Dim i As Integer = 1
For i = 1 To oAddIns.Count
Try
oTransAddIn = oAddIns.Item(i)
WritetoFile(oTextFileName, oTransAddIn.DisplayName & " - " & oTransAddIn.ClassIdString, True)
Catch
End Try
Next
End Sub
Private Sub WritetoFile(TxtFileName As String, TextToAdd As String, Optional ByVal AppendToFile As Boolean = True)
'Dim dateString = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss")
'Dim TxtFileName As String = ThisDoc.PathAndFileName(False) & "_" & dateString & ".txt"
If AppendToFile = True Then
'____Open and append to an existing text file_______
Dim oAppend As System.IO.StreamWriter
'oFile = TxtFileName
oAppend = IO.File.AppendText(TxtFileName)
oAppend.WriteLine(TextToAdd)
oAppend.Flush()
oAppend.Close()
Else
'____Create and write to a text file_________________
oWrite = System.IO.File.CreateText(TxtFileName)
oWrite.WriteLine(TextToAdd)
'oWrite.WriteLine("File Created on " & DateString)
oWrite.WriteLine("")
oWrite.Close()
End If
End Sub
Solved! Go to Solution.