嗨,乐,谢谢你的建议。现在,我可以让填充线在折线对象上工作,但不能在圆和椭圆上工作。
我还想从内部块中删除hatch。请帮帮忙。先谢了。
- Adesk::Boolean KMTPARCEL::worldDraw (AcGiWorldDraw *mode) {
-
- //........................
- AcDbPolyline* pLine = AcDbPolyline::cast(m_pCurve);
- if (pLine) {
- AcGePoint2dArray vertices;
- AcGeDoubleArray bulges;
- int nVerts = pLine->numVerts();
- AcGePoint2d pnt;
- double bulge;
- for (int i=0;igetPointAt(i,pnt);
- pLine->getBulgeAt(i,bulge);
- vertices.append(pnt);
- bulges.append(bulge);
- }
- pLine->getPointAt(0,pnt);
- pLine->getBulgeAt(0,bulge);
- vertices.append(pnt);
- bulges.append(bulge);
-
- AcDbHatch* hatch = new AcDbHatch;
- hatch->setNormal(m_normal);
- hatch->setPatternScale(m_DimScale);
- hatch->setPatternAngle(45);
- hatch->setPattern(AcDbHatch::kPreDefined, _T("NET"));
- hatch->appendLoop(AcDbHatch::kDefault|AcDbHatch::kExternal, vertices,bulges);
- hatch->evaluateHatch();
- hatch->worldDraw(mode);
- delete hatch;
- }
- //........................
- }
Daniel编辑:添加了代码标记 |