- 积分
- 12151
- 明经币
- 个
- 注册时间
- 2002-6-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
AcDbHatch修改后为什么不能更新:
如下一段代码,获得AcDbHatch,修改他的填充图案和颜色,结果颜色修改正确,但图案修改后无论是用Redraw等命令都无法更新显示,只有再编辑后才更新显示。为什么???
void test()
{
AcDbHatch* pObj;
ads_name ent;
ads_point pt1;
acedEntSel("\nhacth:",ent,pt1);
AcDbObjectId objId;
Acad::ErrorStatus es;
acdbGetObjectId(objId,ent);
acdbOpenObject(pObj,objId,AcDb::kForWrite);
es = pObj->evaluateHatch();
es = pObj->setPattern(AcDbHatch::kPreDefined, "ANGLE");
es = pObj->setColorIndex(3);
es = pObj->downgradeOpen();///!!!!!!!!!!!!!!!!!!!!!!!
es = pObj->draw(); //更新实体
pObj->recordGraphicsModified(Adesk::kTrue);
pObj->close();
acedUpdateDisplay();
actrTransactionManager->flushGraphics();
return;
} |
|