- 积分
- 217
- 明经币
- 个
- 注册时间
- 2005-3-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
AcDbHatch* pHatch = new AcDbHatch(); AcGeVector3d normal(0.0, 0.0, 1.0); pHatch->setNormal(normal); pHatch->setElevation(0.0); pHatch->setHatchStyle(AcDbHatch::kNormal);
//设置Hatch模式为预定义AR-CONC类型 pHatch->setPattern(AcDbHatch::kPreDefined, "AR-CONC");
就是这里,预定义的类型设置为SOLID时填充能完成 设置成其他预定义类型就不能实现填充。 大侠们帮我看看问题出在哪里了?
pHatch->setPatternScale(0.2); //设置关联边界 pHatch->setAssociative(Adesk::kTrue); AcDbObjectIdArray dbObjIds; dbObjIds.append(plineID); pHatch->appendLoop(AcDbHatch::kDefault, dbObjIds); AcDbBlockTable* pBlockTable; if(acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead) != Acad::eOk) { delete pHatch; return NULL; } AcDbBlockTableRecord* pBlockTableRecord; if(pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite) != Acad::eOk) { delete pHatch; pBlockTable->close(); return NULL; } pBlockTable->close(); if(pBlockTableRecord->appendAcDbEntity(id, pHatch) != Acad::eOk) { delete pHatch; pBlockTableRecord->close(); return NULL; } pBlockTableRecord->close(); pHatch->close();
AcDbEntity *pEnt; if (acdbOpenAcDbEntity(pEnt, dbObjIds[0], AcDb::kForWrite)==Acad::eOk) { pEnt->addPersistentReactor(id); pEnt->close(); }
|
|