iobjectscpp 9d 910 win10 x64
1.对CAD图层对象设置风格无效。在设置之前已经打开编辑功能
UGDatasetVector * dataset = (UGDatasetVector *) m_pWorkspace ->GetDataSource(0)->GetDataset (_U("Tower_CAD"));
dataset->Open();
UGQueryDef query = UGQueryDef();
UGRecordset* recordset = dataset->Query(query);
int count = recordset->GetRecordCount();
recordset->MoveTo(0);
UGGeometry * pTempGeomtry = nullptr;
recordset->GetGeometry(pTempGeomtry);
UGStyle *style = new UGStyle;
style->SetFillForeColor(UGRGB(255,0,0));
style->SetFillOpaqueRate(60);
pTempGeomtry->SetStyle(style);
qMapControl->Refresh();
2.当我脱离数据集创建一个记录集用于保存部分数据集中的对象,让其进行缓冲分析,但提示recordset->AddNew()返回-1。
UGDatasetVector * dataset = (UGDatasetVector *) m_pWorkspace ->GetDataSource(0)->GetDataset (_U("Tower_R"));
dataset->Open();
UGQueryDef query = UGQueryDef();
UGRecordset* recordset = dataset->Query(query);
int count = recordset->GetRecordCount();
UGRecordset *re = new UGRecordset();
recordset->MoveTo(i - 1);
UGGeometry * pTempGeomtry = nullptr;
recordset->GetGeometry(pTempGeomtry);
int ret = re->AddNew(pTempGeomtry); //返回-1
ret = re->Update();