[英]Trying to read data from a DWG using Autodesk.AutoCAD.DatabaseService What DLL do I need to reference to?
I have a VB winform project where I am reading data from a table inside a DWG file. 我有一个VB winform项目,我在其中从DWG文件中的表读取数据。 By this method AutoCad needs to be open( making the application slower ).
通过这种方法,需要打开AutoCad( 使应用程序变慢 )。
I found the article show below where you can use a different approach where you use a Database object( represent our in-memory drawing ) But I don't know what DLL do I need to reference to be able to use this method. 我发现下面显示的文章可以在其中使用数据库对象( 表示我们的内存中绘图 )的另一种方法,但是我不知道要使用此方法需要引用什么DLL。 The method use on this appraoch is :
此方法使用的方法是:
using Autodesk.AutoCAD.DatabaseServices; 使用Autodesk.AutoCAD.DatabaseServices; --> need to be able to import
->需要能够导入
And also the article is from 2006 and on C#. 这篇文章也来自2006年和C#。 Is there a Better approach now a days ?
现在有更好的方法吗?
Thanks in advance 提前致谢
Breaking it down-A closernLook at the C# code for importing blocks 分解-更仔细地看一下导入块的C#代码
If you create a .DLL that you load inside AutoCAD (with NETLOAD command or with PackageContents.xml/.bundle folder), then you need the following references from AutoCAD install folder: 如果创建要在AutoCAD内部加载的.DLL(使用NETLOAD命令或PackageContents.xml / .bundle文件夹),则需要从AutoCAD安装文件夹获得以下引用:
And make sure all the references are set as Copy Local = false, note this is important :-) 并确保所有引用都设置为Copy Local = false,请注意这很重要:-)
You may have problems with .NET version, so make sure that you have: .NET版本可能存在问题,因此请确保您具有:
And if you choose a older version of .NET, the compiler may throw erros, like cannot use the references. 而且,如果您选择的是.NET的旧版本,则编译器可能会抛出错误,就像无法使用引用一样。 If you are starting, please check at http://www.autodesk.com/myfirstautocadplugin
如果您要开始,请访问http://www.autodesk.com/myfirstautocadplugin
Now, if you have a external application (.exe), then you cannot use the above, but only the COM references (also from AutoCAD install folder) 现在,如果您有外部应用程序(.exe),则不能使用上述应用程序,而只能使用COM引用(也来自AutoCAD安装文件夹)
But for these COM interop you have a different data-model and also a different namespace. 但是对于这些COM互操作,您具有不同的数据模型和名称空间。 Also, this is deprecated, meaning no new features to it.
另外,不建议使用此功能,这意味着没有新功能。
You can get the DLLS from ObjectArx Libraries which are here . 您可以从此处的 ObjectArx库获取DLLS。 When you install them there will be the dlls you need.
当您安装它们时,将有您需要的dll。
Look at AutoCAD`s Developers Guide examples and explanations for the latest "How to". 查看AutoCAD的开发人员指南示例和最新“操作方法”的说明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.