admin 发表于 2024-3-14 20:34:54

//加载一个实体到数据库,返回实体ID

static AcDbObjectId LoadEntity(AcDbEntity* entity)
{
      AcDbBlockTable* pBlockTable;
      acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable,AcDb::kForRead);
      AcDbBlockTableRecord* pBlockTableRecord;
      pBlockTable->getAt(ACDB采用MODEL采用SPACE,pBlockTableRecord,AcDb::kForWrite);

      AcDbObjectId Id;
      pBlockTableRecord->appendAcDbEntity(Id,entity);
      pBlockTable->close();
      pBlockTableRecord->close();

      entity->close();
      return Id;
}
页: [1]
查看完整版本: //加载一个实体到数据库,返回实体ID