回形填充问题

AcDbObjectIdArray arid;
AcDbObjectIdArray arid1;
arid.append(id);
arid1.append(id1);


Acad::ErrorStatus es;

回形填充时,需要分两次,加入边界,每个边界数组只有一个ID才能成功!

AcDbHatch *pHatch = new AcDbHatch();

// 设置填充平面
AcGeVector3d normal(0, 0, 1);
es = pHatch->setNormal(normal);
es = pHatch->setElevation(0);
es = pHatch->setPatternScale(10);
es = pHatch->setPatternAngle(0);

// 设置关联性
es = pHatch->setAssociative(false);

// 设置填充图案
pHatch->setPattern(AcDbHatch::kPreDefined, _T("DOTS"));

// 添加填充边界
es = pHatch->appendLoop(AcDbHatch::kDefault, arid1);
es = pHatch->appendLoop(AcDbHatch::kDefault, arid);


// 显示填充对象
es = pHatch->evaluateHatch();

原文地址:https://www.cnblogs.com/LTools/p/8955550.html