|
AcDbHatch* pHatch = new AcDbHatch();
AcGeVector3d normal(0.0, 0.0, 1.0);
pHatch->setNormal(normal);
pHatch->setElevation(0.0);
// pHatch->setAssociative(Adesk::kFalse);
pHatch->setPattern(AcDbHatch::kPreDefined, "SOLID");
// pHatch->setStyle(AcDbHatch::kNormal);
AcGePoint3d start022(120,100,0);
AcGePoint3d end022(180,100,0);
AcDbLine*a1Line=new AcDbLine(start022,end022);
//水沟右深度
AcGePoint3d start032(180,100,0);
AcGePoint3d end032(180,160,0);
AcDbLine*b1Line=new AcDbLine(start032,end032);
//水沟下宽度
AcGePoint3d start042(180,160,0);
AcGePoint3d end042(120,160,0);
AcDbLine*c1Line=new AcDbLine(start042,end042);
//水沟左直边
AcGePoint3d start052(120,160,0);
AcGePoint3d end052(120,100,0);
AcDbLine*d1Line=new AcDbLine(start052,end052);
postToModel(a1Line);
postToModel(b1Line);
postToModel(c1Line);
postToModel(d1Line);
a1Line->close();
b1Line->close();
c1Line->close();
d1Line->close();
AcDbObjectIdArray objIds;
//objIds.append(idpSemiCircle);
//objIds.append(idp1SemiCircle);
objIds.append(ida1Line);
objIds.append(idb1Line);
objIds.append(idc1Line);
objIds.append(idd1Line);
pHatch->appendLoop(AcDbHatch::kExternal, objIds);
// Construct a circle
// Elaborate solid fill
pHatch->evaluateHatch();
// Post hatch entity to database
postToModel(pHatch);
pHatch->close();
没有错误,但是不能实现填充,不知错在哪里,请指教,谢谢!
|
|