求助怎么画类似内部空心的环形填充
就是2个闭合多段线,1个包含另一个,然后做填充,内部的无填充,arx要怎么处理?http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 山水夜雨的微博 给你一段示例代码:
// - Algorithms._HHH command (do not rename)
static void Algorithms_TestHatch(void)
{
int ret;
ads_name sel,ent;
resbuf filter;
filter.restype = 0;
filter.resval.rstring = _T("LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE");
filter.rbnext = NULL;
ret = acedSSGet(NULL,NULL,NULL,&filter,sel);
if (ret == RTNORM)
{
long n;
AcDbObjectId id;
AcDbObjectIdArray ids;
AcDbObjectPointer<AcDbHatch> hatch;
hatch.create();
hatch->setPatternScale(5);
hatch->setPattern(AcDbHatch::kPreDefined,_T("ANSI31"));
hatch->setHatchStyle(AcDbHatch::kNormal);
acedSSLength(sel,&n);
for (int i=0;i<n;i++)
{
acedSSName(sel,i,ent);
acdbGetObjectId(id,ent);
ids.append(id);
hatch->appendLoop(AcDbHatch::kDefault,ids);
hatch->evaluateHatch();
ids.setLogicalLength(0);
}
//取消如下注释,以设置你的标高和法线之类以及填充关联(需要反应器)
//hatch->setNormal(AcGeVector3d(0,0,1));
//hatch->setElevation(0);
//hatch->setAssociative(false);
AcDbBlockTableRecordPointer curSpace(acdbCurDwg()->currentSpaceId(),AcDb::kForWrite);
Acad::ErrorStatus es = curSpace->appendAcDbEntity(hatch.object());
if (es != Acad::eOk)
{
acutPrintf(_T("\n创建填充失败!"));
}
}
}
刚路过,见一回顶一回
页:
[1]