Hi @matt_jlt. There is a code routine find out what the available options are within a TranslatorAddIn. It's not perfect, but often gets you most of the way there. It will tell you what the official names of each option are, and what their current values are, but won't tell you what all the possible values are for each option, or what Enum (pre-established enumeration of variations of some type) (if any) the option's value may be a variation of. There appear to be two different translator add-ins for these two, but both appear to be defined within the same .dll file (DWGTrans.dll). And when I run this code on both of these, I get the same results. It also depends on which type of document you have open/active when you run the rule. (You get different results when a model file is open than you do when a drawing file is open, because there are different options for each situation.)
When an .idw drawing file is open, it returns one option for both translator add-ins:
option name = "Export_Acad_IniFile"
option value = (a String - the full path and file name of the .ini file to be used, including the .ini file extension)
When a model file is open, it returns 4 options:
option name = "Solid"
Option value = (Boolean - True/False)
option name = "Surface"
option value = (Boolean - True/False)
option name = "Sketch"
option value = (Boolean - True/False)
option name = "DwgVersion"
option value = (a number - for example 33)
I would assume the scale setting you are talking about is set up within the .ini file. If you have previously gone through the export process of a drawing manually, and saved the configuration, you were presented with a file explorer screen where you can specify a location and name for the .ini file it creates. You would need to point this option's value to the full path and file name of the .ini file you used in that process.
Here is the iLogic rule to get the options:
Sub Main
'specify document to be exported/translated
Dim oDoc As Document = ThisDoc.Document
'Get the target TranslatorAddIns to process
Dim oDXF As TranslatorAddIn
Dim oDWG As TranslatorAddIn
For Each oAppAddin As ApplicationAddIn In ThisApplication.ApplicationAddIns
If oAppAddin.DisplayName = "Translator: DXF" Then
oDXF = oAppAddin
ElseIf oAppAddin.DisplayName = "Translator: DWG" Then
oDWG = oAppAddin
End If
Next
'prepare variables to hold values returned from custom Function below
Dim oDXFOptions As String
Dim oDWGOptions As String
'make sure TranslatorAddIn was found, then run Function
If Not IsNothing(oDXF) Then
oDXFOptions = GetTranslatorOptions(oDoc, oDXF)
End If
If Not IsNothing(oDWG) Then
oDWGOptions = GetTranslatorOptions(oDoc, oDWG)
End If
'report the results
MsgBox(oDXFOptions, , "DXF Options")
MsgBox(oDWGOptions, , "DWG Options")
End Sub
Function GetTranslatorOptions(oDocToExp As Document, oTransAddIn As TranslatorAddIn) As String
'The following lines create the needed input variables
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kUnspecifiedIOMechanism
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
Dim oOptionsString As String = String.Empty
'When you provide the input variables, it fills in the Options (names & values) for you
If oTransAddIn.HasSaveCopyAsOptions(oDocToExp, oContext, oOptions) Then
'the next line would show the options dialog
'oTransAddIn.ShowSaveCopyAsOptions(oDocToExp, oContext, oOptions)
Dim oItem As Integer = 1
For Each oPair In oOptions 'do not define Type of oPair ahead of time
oOptionsString = oOptionsString & vbCrLf & "Option Name = " & oOptions.Name(oItem) & vbCrLf & "Option Value = " & oOptions.Value(oOptions.Name(oItem)) & vbCrLf
'this next line would write each option to the Logger
'Logger.Trace("Option Name = " & oOptions.Name(oItem) & " / Option Value = " & oOptions.Value(oOptions.Name(oItem)))
'MsgBox(oOptions.Name(oItem) & " = " & oOptions.Value(oOptions.Name(oItem)), , "")
oItem = oItem + 1
Next
End If
Return oOptionsString
End Function
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)