void CreateDh() {AcDbDatabase *pCurDb; pCurDb=acdbHostApplicationServices()->workingDatabase(); AcDbBlockTable * pBlockTable; pCurDb->getBlockTable(pBlockTable,AcDb::kForRead); AcDbBlockTableRecord * pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite); pBlockTable->close(); AcDbObjectId DhId;
double x,y,z; int Count=Pointx.GetSize(); for(int i=0;i<Count;i++) {x=atof(Pointx.GetAt(i)); y=atof(Pointy.GetAt(i)); z=atof(PointGc.GetAt(i)); AcGePoint3d Pt(x,y,z); AcDbPoint * Dh= new AcDbPoint(Pt);
pBlockTableRecord->appendAcDbEntity(DhId,Dh); } pBlockTableRecord->close();
}
为什么我这段代码有错误 在CADA2002运行后出现问题是不是没有关闭对象但是我加入Dh->close() 语句VC编译通不过 不光是AcDbPoint AcDbText ->close()也不行我看书上例子写有这些关闭对象的语句为什么我搬过来就不行 指教!! |