|
[code]void createPolyline(std::vector<double> polylineDot){
AcGePoint3dArray ptArr;
size_t polylineDotLogicalSize = polylineDot.size() / 3;
ptArr.setLogicalLength(polylineDotLogicalSize);
size_t iter = 0;
for(int i = 0; i < polylineDotLogicalSize; i++){
ptArr[i].set(polylineDot.at(iter), polylineDot.at(iter + 1), polylineDot.at(iter + 2));
iter = iter + 3;
}
AcDb3dPolyline *pNewPolyLine = new AcDb3dPolyline(AcDb::k3dSimplePoly, ptArr, Adesk::kFalse);
pNewPolyLine->setColorIndex(3);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices() -> workingDatabase() -> getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
//AsdkDbReactor дочка AcDbDatabaseReactor, gpDbr объект класса AsdkDbReactor
if(gpDbr == NULL){
gpDbr = new AsdkDbReactor();
}
acdbHostApplicationServices() -> workingDatabase() -> addReactor(gpDbr);
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId polylineObjectId;
pBlockTableRecord->appendNcDbEntity(polylineObjectId, pNewPolyLine);
pBlockTableRecord->close();
pNewPolyLine->setLayer(L"0");
pNewPolyLine->close();
}
[/code] |
|