您好,标绘对象绘制在地图中的可编辑CAD图层,保存在对应的CAD数据集中,要清除的话,需要对数据集进行操作.
UGDataSource* datasource = pWorkSpace->GetDataSource(_U("World")); // 获取数据源
UGDatasetVector *pToDataset = (UGDatasetVector*)datasource->GetDataset(_U("DrawCAD")); 获取数据集
pToDataset->GetType();
UGQueryDef queryDef;
pToDataset->Open(); // must
queryDef.m_nType = UGQueryDef::General;
if (pToDataset->GetType() == UGDataset::Tabular)
{
queryDef.m_nOptions = UGQueryDef::Attribute;
}
else
{
queryDef.m_nOptions = UGQueryDef::Both;
}
queryDef.m_nMode = UGQueryDef::GeneralQuery;
queryDef.m_nCursorType = UGQueryDef::OpenDynamic;
UGRecordset *pToRecordset = pToDataset->Query(queryDef);
pToRecordset->DeleteAll(); // 删除所有记录
pToRecordset->Close();
delete pToRecordset;