代码如下: AcDbObjectIdArray dbObjIds; AcDbHatch* pHatch; AcGeVector3d normal(0.0 , 0.0 , 1.0 );
dbObjIds.append(LineId[7]); dbObjIds.append(LineId[8]); dbObjIds.append(LineId[9]); dbObjIds.append(LineId[3]); //LineId是四边形的四条边的Id pHatch = new AcDbHatch(); pHatch -> setNormal(normal); pHatch -> setElevation(0.0); pHatch -> setAssociative(Adesk::kFalse); pHatch -> setColorIndex(162); pHatch -> setPatternScale(0.0); pHatch -> setPatternAngle(0.0); pHatch -> setPattern(AcDbHatch::kPreDefined, "ANSI31"); pHatch -> setHatchStyle(AcDbHatch::kNormal); pHatch -> appendLoop(AcDbHatch::kExternal, dbObjIds); pHatch -> evaluateHatch(); AddEntityToDbs( pHatch ); // AddEntityToDbs()函数用于将填充加入到数据库,函数没有问题 pHatch -> close(); 代码是参考了网上的一些信息写的,程序在调试时填充显示不了,请问下是什么原因?谢谢! |