还可以使用以下 API 为派生类创建 COM 对象:AcDbObject IAcadBlock::AddCustomObject(BSTR ClassName, LPDISPATCH* pObject) IAcadModelSpace::AddCustomObject(BSTR ClassName, LPDISPATCH* pObject) IAcadPaperSpace::AddCustomObject(BSTR ClassName, LPDISPATCH* pObject) IAcadDictionary::AddObject(BSTR Keyword, BSTR ObjectName, struct IAcadObject** pObject) 这些 API 仅使用派生类名(例如,),创建 COM 对象,然后调用其实现。反过来,调用 COM 包装器的函数您的实现应创建派生类的实例并将其添加到数据库中。有关如何编写的示例,请参阅向对象模型添加自定义对象或实体。AcDbObjectAcDbMyObjectIAcadBaseObject::SetObjectId()SetObjectId()IAcadBaseObject::CreateNewObject(). CreateNewObject() AcDbObjectCreateNewObject() |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:27
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.