- UID
- 13475
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-30
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我是一个初学者,请各位帮我看一下,下面是画一个园,然后填充,程序编译通过,但运行时没有填充出来。
void test()
{
ads_point pt1;
if(ads_getpoint(NULL,"\n请输入插入点:",pt1)!=RTNORM) return;
AcGePoint3d basePoint(pt1[0],pt1[1],pt1[2]);
AcDbCircle *pCircle=new AcDbCircle;
pCircle->setCenter(basePoint);
pCircle->setRadius(1.5);
pCircle->setColorIndex(1);
AcDbHatch* pHatch = new AcDbHatch();
AcGeVector3d normal(0.0, 0.0, 1.0);
pHatch->setNormal(normal);
pHatch->setElevation(0.0);
pHatch->setAssociative(Adesk::kTrue);
pHatch->setPattern(AcDbHatch::kPreDefined, "SOLID");
pHatch->setHatchStyle(AcDbHatch::kNormal);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId circleId;
AcDbObjectId hatchId;
AcDbObjectIdArray dbObjIds;
pBlockTableRecord->appendAcDbEntity(circleId,pCircle);
dbObjIds.setLogicalLength(0);
dbObjIds.append(circleId);
pHatch->appendLoop(AcDbHatch::kDefault, dbObjIds);
pHatch->evaluateHatch();
dbObjIds.setLogicalLength(0);
pHatch->getAssocObjIds(dbObjIds);
pBlockTableRecord->appendAcDbEntity(hatchId,pHatch);
pBlockTableRecord->close();
AcDbEntity *pEnt;
int numObjs = dbObjIds.length();
Acad::ErrorStatus es;
int i;
for (i = 0; i < numObjs; i++) {
es = acdbOpenAcDbEntity(pEnt, dbObjIds, AcDb::kForWrite);
if (es == Acad::eOk) {
pEnt->addPersistentReactor(hatchId);
pEnt->close();
}
}
pCircle->close();
pHatch->close();
} |
|