经过2天的查找,问题已经得到解决,最终在Autodesk官方的.net开发文档中找到了答案。 这个是官方回答: When you develop a new application, it can either run in or out-of-process. The AutoCAD .NET API is designed to run in-process only, which is different from the ActiveX Automation library which can be used in or -out-of-process. ...... If you need to create a stand-alone application to drive AutoCAD, it is best to create an application that uses the CreateObject and GetObject methods to create a new instance of an AutoCAD application or return one of the instances that is currently running. Once a reference to an AcadApplication is returned, you can then load your in-process .NET application into AutoCAD by using the SendCommand method that is a member of the ActiveDocument property of the AcadApplication. 简单的说.NET API 开发技术是专用于CAD进行“内部控制”的。而我需要实现的是一个通过外部程序控制CAD绘图的东西,目前仍然只有ActiveX Automation可以实现这一点,所以我这种开发要求,还是只能通过VBA来实现。 (可能理解的还有偏差,如果有错请大家指出) (此回复中的VBA不准确,准确的是VB.net+Com类实现,因为程序内部的变量,与其说再找方法传递入Dll,还不如用VBA技术简单的解决掉,反正应用范围也不复杂) |