- static void Test_x1(void)
- {
- // -- Get Layer's ObjectId for Freeze;
- AcDbObjectId FrzLay = acdbHostApplicationServices()->workingDatabase()->clayer();
- // -- Make to a array for freezeLayer use
- AcDbObjectIdArray FrzArray;
- FrzArray.removeAll();
- FrzArray.append(FrzLay);
- // -- get all the viewport's objectId, but not paperSpace.
- AcDbObjectIdArray vps;
- vps.removeAll(); // -- clear it;
- Acad::ErrorStatus es = Acad::eInvalidInput;
- es = acdbHostApplicationServices()->workingDatabase()->getViewportArray(vps, false);
- if (es != Acad::eOk)
- {
- acutPrintf(_T("\nError(getViewportArray): %s"), acadErrorStatusText(es));
- return;
- }
- if (vps.isEmpty())
- {
- acutPrintf(_T("\nError(Viewport's IdArray): none viewport in it."));
- return;
- }
- for (int i = 0; i freezeLayersInViewport(FrzArray);
- if (es != Acad::eOk)
- {
- acutPrintf(_T("\nError(FrzInVp): %s"), acadErrorStatusText(es));
- pEnt->close();
- continue;
- }
- /* UpdataDisplay? but it no work. this viewport have no change. */
- pEnt->updateDisplay();
- pEnt->close();
- }
- }
我已将此代码写入所有视口上的冻结当前层。但没有我认为的工作。
命令完成时视口不会更新数据。
但是,如果我复制一个视口,层(我想要冻结的)已经在副本上冻结了......
查看Gif:
u045xum4seg.gif
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |