tuankm 发表于 2009-1-15 09:48:11

嗨,乐,谢谢你的建议。现在,我可以让填充线在折线对象上工作,但不能在圆和椭圆上工作。
我还想从内部块中删除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编辑:添加了代码标记

Draftek 发表于 2009-1-15 10:03:13

谢谢乐。
页: 1 [2]
查看完整版本: 救命啊!自定义对象中的图案填充曲线