- UID
- 13153
- 积分
- 45
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-28
- 最后登录
- 1970-1-1
|
发表于 2003-8-12 11:29:33
|
显示全部楼层
Acad::ErrorStatus FunHatch(const AcDbObjectId& idOut,const AcDbObjectIdArray& idsInter,char* szHatchType)
{
AcDbHatch* pHatch = new AcDbHatch();
AcGeVector3d normal(0.0, 0.0, 1.0);
pHatch->setNormal(normal);
pHatch->setElevation(0.0);
pHatch->setPattern(AcDbHatch::kPreDefined, szHatchType);
pHatch->setAssociative(Adesk::kTrue);
AcDbObjectIdArray ids;
//external loops
ids.append(idOut);
pHatch->appendLoop(AcDbHatch::kExternal, ids);
//internal loops
int len=idsInter.length();
if(len>0)
{
//first must appendLoop an internal loop
ids.setLogicalLength(0);
ids.append(idsInter[0]);
pHatch->appendLoop(AcDbHatch::kDefault,idsInter);
//then insert other internal loops
for(int i=1;i<len;i++)
{
ids.setLogicalLength(0);
ids.append(idsInter);
pHatch->insertLoopAt(i,AcDbHatch::kDefault,ids);
}
}
pHatch->evaluateHatch();
Acad::ErrorStatus es;
//append to database
es=AppendToDB(pHatch);
return es;
} |
|