根据AutoCAD .NET Developer‘s Guide中的相关章节,当同时使用.NET API和ActiveX Automation时,如果你定义了一个需要返回一个对象的函数,推荐返回该对象的对象标识(ObjectId)而不是对象本身。更多关于对象标识的信息,可查看“使用对象标识”。但是ObjectID会随着每次AutoCAD打开而发生变化。
Each object contained with in the Database object is assigned several unique ids. The unique ways you can access objects are:
Entity handle
ObjectId
Instance pointer
The most common method is to access an object by its Object Id. Object Ids work well if your projects utilize both COM interop and the managed .NET API. If you create custom AutoLISP functions, you may need to work with entity handles.
所以你可以试试Entity Handle和Instance Pointer吧,祝你好运。