Ilogic publish rule, save as AutoCAD .dwg error

Ilogic publish rule, save as AutoCAD .dwg error

Anonymous
Not applicable
641 Views
2 Replies
Message 1 of 3

Ilogic publish rule, save as AutoCAD .dwg error

Anonymous
Not applicable
            ' Get the DWG translator Add-In. 
            strDWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
            strContext = ThisApplication.TransientObjects.CreateTranslationContext
            strContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
            strOptions = ThisApplication.TransientObjects.CreateNameValueMap
            strDataMedium = ThisApplication.TransientObjects.CreateDataMedium

            ' Check whether the translator has 'SaveCopyAs' options 
            If strDWGAddIn.HasSaveCopyAsOptions(strDocument, strContext, strOptions) Then
                ' DWG version.
                ' 23 = ACAD 2000
                ' 25 = ACAD 2004
                ' 27 = ACAD 2007
                ' 29 = ACAD 2010 
               strOptions.Value("DwgVersion") = 27
               Dim strIniFile As String
               strIniFile = "D:\Local Server\Data\Heaslip Autodesk Customization\Templates\DWGSubmittalConfig.ini"

                ' Create the name-value that specifies the ini file to use. 
                strOptions.Value("Export_Acad_IniFile") = strIniFile
            End If

            'Set the DWG target file name
            strDataMedium.FileName = strFullFileName

            'Publish the active sheet as DWG 2007
            strDWGAddIn.SaveCopyAs(strDocument, strContext, strOptions, strDataMedium)

The above is part of a longer rule that steps through a multi-sheet .idw file and publishes to .pdf and .dwg format.  At one time it worked, probably with IV 2012, but since then the .dwg portion shown above throws errors (now running IV 2014 and soon 2016).

 

I am by no means a programmer but have just assembled the rule with the help of lots of different people here over time...any help would be greatly appreciated.  Below is the error description:

 

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

Any ideas?

 

This is what

 

Any ideas what is wrong

0 Likes
642 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Just to add to the confusion, I have a coworker and my code runs fine on his machine.  To me that implies the issue is not with the code itself, rather with my VB installation or folders permissions.  I don't think it is the latter, perhaps the former.

 

The actual error message reads as follows:

 

Error in rule: NZASTitleBlock, in document: 1900DrawingSet-20151210-InitialIssueA.idw

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

 

Help?

0 Likes
Message 3 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi Rob,

 

I would try to reproduce it in VBA where you can step through the code or at least add some logging parts in the iLogic code so I could see how far it gets and what values it's using.

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes