试图读取使用Autodesk.AutoCAD.DatabaseService什么DLL我需要引用到DWG数据?数据、AutoCAD、Autodesk、DatabaseService

2023-09-06 10:26:52 作者:用命博青春′

我有一个VB的winform项目中,我从一个表中读取里面的DWG文件数据。 通过这种方法的AutoCad需要开放(提出申请慢)。

I have a VB winform project where I am reading data from a table inside a DWG file. By this method AutoCad needs to be open(making the application slower).

我发现下面,你可以使用,你使用一个数据库对象不同的方法的文章显示(再present我们在内存中的图纸),但我不知道该怎么做的DLL我需要引用,以便能够使用该方法。在此appraoch的方法,使用方法是:

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. The method use on this appraoch is :

使用Autodesk.AutoCAD.DatabaseServices; - >需要能够导入

using Autodesk.AutoCAD.DatabaseServices; --> need to be able to import

和也的文章是从2006年和C#。有没有更好的办法现在是一个天?

And also the article is from 2006 and on C#. Is there a Better approach now a days ?

在此先感谢

将它分解-A closernLook在C#$ C $下导入块

推荐答案

如果您创建在AutoCAD负载(用NETLOAD命令或PackageContents.xml / .bundle文件夹)一个.DLL,则需要从以下引用AutoCAD的安装文件夹:

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:

AcMgd.dll AcDbMgd.dll AcCoreMgd.dll(这是必需的AutoCAD的2013年和更新)

和确保所有的引用都设置为复制本地=假,注意,这是很重要的: - )

And make sure all the references are set as Copy Local = false, note this is important :-)

您可能有问题,.NET版本,所以请确保您有:

You may have problems with .NET version, so make sure that you have:

为AutoCAD .NET 3.5 2010 + 在.NET 4.0中为AutoCAD 2012 + 为AutoCAD .NET 4.5 2015年+

如果你选择.NET的旧版本,编译器可能会引发错误回报,就像不能使用引用。如果你开始,请在 http://www.autodesk.com/myfirstautocadplugin

And if you choose a older version of .NET, the compiler may throw erros, like cannot use the references. If you are starting, please check at http://www.autodesk.com/myfirstautocadplugin

现在,如果你有一个外部应用程序(.exe)的,那么你就不能使用上面的,但是的仅的COM引用(也从AutoCAD安装文件夹中)

Now, if you have a external application (.exe), then you cannot use the above, but only the COM references (also from AutoCAD install folder)

Autodesk.AutoCAD.Interop.dll Autodesk.AutoCAD.Interop.Common.dll

但这些COM互操作你有不同的数据模型,也有不同的命名空间。此外,这是pcated德$ P $,这意味着没有新的功能吧。

But for these COM interop you have a different data-model and also a different namespace. Also, this is deprecated, meaning no new features to it.