- UID
- 395050
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2006-2-16
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
请朋友帮忙看看,急哦
void fl()
{
ads_name ents,ent;
AcDbObjectId objId;
AcDbEntity* pEnt=NULL;
AcDbObjectIdArray dbObjIds;
acedSSGet(NULL,NULL,NULL,NULL,ents);
long len;
acedSSLength(ents,&len);
AcDbHatch* pHatch = new AcDbHatch();
for(long i=0;i<len;i++) {
acedSSName(ents,i,ent);
acdbGetObjectId(objId, ent);
dbObjIds.append(objId);
if(acedSSName(ents,i,ent)!=RTNORM)
{
acutPrintf("ent error,No:&Id",i);
return;
}
//acdbGetObjectId(objId,ent);
if(objId.isNull()||!objId.isValid())
{
acutPrintf("\nERROR!!Id is NULL or invalid!");
return;
}
acedSSFree(ent);
acedSSFree(ents);
}
AcGeVector3d normal(0.0, 0.0, 1.0);
pHatch->setNormal(normal);
pHatch->setElevation(0.0);
pHatch->setColorIndex(3);
pHatch->setPatternScale(2);
pHatch->setPatternAngle(0.0);
pHatch->setPattern(AcDbHatch::kPreDefined, "ANSI31");
pHatch->setHatchStyle(AcDbHatch::kNormal);
pHatch->appendLoop(AcDbHatch::kExternal, dbObjIds);
pHatch->draw(); //更新实体
pHatch->recordGraphicsModified(Adesk::kTrue);
// Set Associativity
//
pHatch->setAssociative(Adesk::kFalse);
pHatch->evaluateHatch();
acedUpdateDisplay();
AcDbBlockTable *pBlockTable=NULL;
AcDbBlockTableRecord *pBlockTableRecord;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pBlockTable, AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId HatchId;
pBlockTableRecord->appendAcDbEntity(HatchId, pHatch);
pBlockTableRecord->close();
pHatch->close();
} |
|