阿母孙 发表于 2012-5-14 14:22:03

CAD 错误

dynamic AutoCAD = AutomationFactory.CreateObject("AutoCAD.Application");
            //dynamic aCADutil = AutoCAD.Utility;
            AutoCAD.Visible = true;
            //dynamic mospace = AutoCAD.ModelSpace;
             dynamic doc = AutoCAD.ActiveDocument;
         
             doc.Open("D:\\2Dsample1.dwg");


错误:
System.Runtime.InteropServices.COMException (0x80210070): 發生例外狀況於 HRESULT: 0x80210070 ---> MS.Internal.ComAutomation.ComAutomationObjectExcep​tion: 發生例外狀況於 HRESULT: 0x80210070
(Source=AutoCAD)
(HelpFile=C:\Program Files (x86)\AutoCAD 2008\HELP\OLE_ERR.CHM#2149646448)
   於 MS.Internal.ComAutomation.ComAutomationNative.Chec​kInvokeHResult(UInt32 hr, String memberName, String exceptionSource, String exceptionDescription, String exceptionHelpFile, UInt32 exceptionHelpContext)
   於 MS.Internal.ComAutomation.ComAutomationNative.Invo​ke(Boolean tryInvoke, String memberName, ComAutomationInvokeType invokeType, ComAutomationInteropValue[] rgParams, IntPtr nativePeer, ComAutomationInteropValue& returnValue)
   於 MS.Internal.ComAutomation.ComAutomationObject.Invo​keImpl(Boolean tryInvoke, String name, ComAutomationInvokeType invokeType, Object& returnValue, Object[] args)
   於 MS.Internal.ComAutomation.ComAutomationObject.Invo​ke(String name, ComAutomationInvokeType invokeType, Object[] args)
   於 System.Runtime.InteropServices.Automation.Automati​onMetaObjectProvider.TryInvokeMember(InvokeMemberB​inder binder, Object[] args, Object& result)
   於 System.Runtime.InteropServices.Automation.Automati​onMetaObjectProviderBase.<.cctor>b__4(Object obj, InvokeMemberBinder binder, Object[] args)
   於 CallSite.Target(Closure , CallSite , Object , String )
   於 System.Dynamic.UpdateDelegates.UpdateAndExecuteVoi​d2(CallSite site, T0 arg0, T1 arg1)
   於 SilverlightOOBDemo.OutofBrowserMainPage.wordBtn_Cl​ick(Object sender, RoutedEventArgs e)
   於 System.Windows.Controls.Primitives.ButtonBase.OnCl​ick()
   於 System.Windows.Controls.Button.OnClick()
   於 System.Windows.Controls.Primitives.ButtonBase.OnMo​useLeftButtonUp(MouseButtonEventArgs e)
   於 System.Windows.Controls.Control.OnMouseLeftButtonU​p(Control ctrl, EventArgs e)
   於 MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}

zhuirvine 发表于 2012-5-14 22:34:20

试试这个
Dim acadapp As AcadApplication
AcadApp = CreateObject("AutoCAD.Application")
AcadApp.Visible = True '界面可视
话说你是用.com方式启动CAD的吧

yu54211168 发表于 2012-5-14 23:50:43

剔除恐龙美化校园!
页: [1]
查看完整版本: CAD 错误