- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using Inventor 2015 run as administrator and I keep getting the error:
Error in rule: DWG EXPORT, in document: 99999.IDW
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.ApplicationAddIns.get_ItemById(String ClientId)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
this is the code:
' Get the DWG translator Add-In. Dim DWGAddIn As TranslatorAddIn DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3?AC2-122E-11D5-8E91-0010B541CD80}") 'Set a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options Dim strIniFile As String 'strIniFile = "O:\Templates\INVENTOR\EXPORT TEMPLATES\" & iProperties.Value("CUSTOM", "INI FILE") strinifile = "O:\TEMPLATES\INVENTOR\EXPORT TEMPLATES\6=1-0EXPORT.INI" ' Create the name-value that specifies the ini file to use. oOptions.Value("Export_Acad_IniFile") = strIniFile 'oDataMedium.FileName = iProperties.Value("CUSTOM", "DWG PATH") & iProperties.Value("CUSTOM", "DWGNO") & ".DWG" oDataMedium.FileName = "O:\TEMPORARY.DWG" 'Publish document. DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
Any help will be appreciated
Solved! Go to Solution.