Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to know why code 'Save as DWG Translator Sample' from the Inventor API Help (see below the iLogic edition) generates Exception from HRESULT: 0x80070057 (E_INVALIDARG) on the attached IDW?
' Public Sub PublishDWG()
' Get the DWG translator Add-In.
Dim DWGAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}")
'Set a reference to the active document (the document to be published).
Dim oDocument As Document = ThisApplication.ActiveDocument
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check whether the translator has 'SaveCopyAs' options
If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
Dim strIniFile As String
strIniFile = "C:\temp\DWGOut.ini"
' Create the name-value that specifies the ini file to use.
oOptions.Value("Export_Acad_IniFile") = strIniFile
End If
'Set the destination file name
oDataMedium.FileName = "c:\tempdwgout.dwg"
'Publish document.
Call DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) ' The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
' End SubPS:
Dear @MjDeck could you, please, study this?
PS:
The issue was reproduced on Inventor 2024.3.3 and 2025.2.1.
Please vote for Inventor-Idea Text Search within Option Names
Solved! Go to Solution.