TA的每日心情 | 开心 昨天 06:36 |
---|
签到天数: 15 天 [LV.4]偶尔看看III
管理员
- 积分
- 1308
|
- static AcDbObjectId OffsetEnty(AcDbObjectId idBlock, AcDbObjectId entId, double OfsValue)
- {
- AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
- AcDbEntity* pEnt;
- AcDbCurve* pCurv;
- AcDbVoidPtrArray offCurvs;
- AcDbBlockTableRecord* pBlkTableRecord;
- Acad::ErrorStatus es;
- AcDbObjectId objctid;
- es = acdbOpenObject(pEnt, entId, AcDb::kForRead);
- if ((pCurv = AcDbCurve::cast(pEnt)) == NULL) {
- pEnt->close();
- return NULL;
- }
- es = pCurv->getOffsetCurves(OfsValue, offCurvs);
- if (es != Acad::eOk) {
- pEnt->close();
- return AcDbObjectId::kNull;
- }
- pEnt->close();
- if ((es = acdbOpenObject(pBlkTableRecord, idBlock, AcDb::kForWrite)) == Acad::eOk)
- {
- for (int i = 0; i < offCurvs.length(); i++) {
- pEnt = (AcDbEntity*)offCurvs.at(i);
- es = pBlkTableRecord->appendAcDbEntity(objctid, pEnt);
- if (es)
- delete pEnt;
- else
- pEnt->close();
- }
- pBlkTableRecord->close();
- }
- return objctid;
- }
复制代码 |
|