VB.NET开发AUTOCAD时常遇到的错误
1.在带有窗体的DLL中出现下面的错误:eLockViolation.
解决方法:
Private sub Test()
'在Sub里添加下面的定义语句
Dim documentLock As DocumentLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument()
'......Sub的内容
documentLock.Dispose()
End Sub
2. 组件\"Autodesk.AutoCAD.AcInfoCenterConn.MyAutoCADBalloon\"不具有由 URI \"/AcWindows:component/infocenteracconn/myautocadballoon.xaml\"识别的资源..
在vbnet类库的调试对话框中选择了启动外部程序(CAD)启动后出错:
解决方法:
在vbnet解决方案的属性里选择\"引用\"标签,把里面的acdbmgd和acmgd的复制本地属性改为false
3.创建带窗体的类库文件时,会在即时窗口中出现n多警告,用下面方法去掉它们:
转自:http://blog.sina.com.cn/s/blog_49a9ee14010195ih.html
Suppressing DataBinding ‘error’ messages in the Visual Studio output window
There’s a thread on the Autodesk discussion forums about the ‘error’ messages displayed in the Visual Studio output window when you launch AutoCAD from the debugger. These messages look like this:
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value=' BindingExpression:Path=AutomationName; DataItem='ToolBarCustomizeButton' (HashCode=441234); target element is 'ToolBarToggleButton' (Name='mCustomizeButton'); target property is 'Name' (type 'String') The messages are disconcerting because they makesit look like there’s something horribly wrong with your project. Don’t panic – these messages don’t mean you’ve got a problem. They’re just a result of how Microsoft handles WPF behind the scenes, and have been appearing in the output windows of AutoCAD plug-in developers around the world since the AutoCAD 2009 release was launched with a WPF ribbonbar. You can safely ignore them. If you want to go one step further and remove them, you can edit your acad.exe.config file (located in your AutoCAD installation folder) to add the lines highlighted in yellow below: While we’re at it, you also don’t have to worry about the ‘First Chance Exception’ errors you also see in the debugger output window when AutoCAD starts. These just indicate an exception has been thrown for some reason or other. An exception being thrown isn’t a big deal – the problem only comes if the are not handled. 因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- efsc.cn 版权所有 赣ICP备2024042792号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务