AcDbHatch *p_AcDbHatch;
AcGeDoubleArray m_AcGeDoubleArray;
AcGePoint3d m_AcGepoint3d1;
AcGePoint3d m_AcGepoint3d2;
double m_bulge; for(j=0;j<p_line_lunkuo->numVerts();j++) //遍历AcDbPolyline各点
{
p_line_lunkuo->getPointAt(j,m_AcGepoint3d);
m_AcGepoint2d.x=m_AcGepoint3d.x;
m_AcGepoint2d.y=m_AcGepoint3d.y;
m_AcGePoint2dArray.append(m_AcGepoint2d);
p_line_lunkuo->getBulgeAt(j,m_bulge);
m_AcGeDoubleArray.append(m_bulge);
}
m_xdmianjilunkuoIdArray.append(p_line_lunkuo->objectId());
p_AcDbHatch=new AcDbHatch();
p_AcDbHatch->setNormal(normal);
p_AcDbHatch->setElevation(0.0);
p_AcDbHatch->setAssociative(Adesk::kTrue);
p_AcDbHatch->setPatternScale(5);
p_AcDbHatch->setPattern(AcDbHatch::kPreDefined,"ANSI31");
p_AcDbHatch->setHatchStyle(AcDbHatch::kNormal);
p_AcDbHatch->evaluateHatch();
p_AcDbHatch->setColorIndex(3);
p_AcDbHatch->appendLoop(AcDbHatch::kExternal,m_xdmianjilunkuoIdArray);//用这句不行
p_AcDbHatch->appendLoop(AcDbHatch::kExternal,m_AcGePoint2dArray, m_AcGeDoubleArray);// /用这句也不行
addEntityToDbs_ACDB_MODEL_SPACE(p_AcDbHatch);//这是一个将实体加入到数据库的函数 |