Files
envi-code/SourceCode/Code2026/CoreCommand/ent2db.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

29 lines
474 B
C++

#pragma once
namespace ENT2DB
{
void export2Db();
void importByDb();
void extractSection();
template <class T>
static bool isEntity(AcDbEntity *pEnt)
{
if (!pEnt) return false;
if (pEnt->isKindOf(T::desc())) return true;
return false;
}
template <class T>
static bool isEntity(AcDbObjectId id)
{
AcDbObjectPointer<AcDbEntity> pEnt(id, AcDb::kForRead);
if (pEnt.openStatus() == Acad::eOk)
{
return isEntity<T>(pEnt);
}
return false;
}
}