![]() |
【转帖】cant update a viewport, invalid execution
can't update a viewport, invalid execution
can't update a viewport, invalid execution in our software i create a new layout in a drawing. in the layout i create a viewport in order to display some model space data. but the problem is that i can't get the vieport to display anything. if i save the drawing and open it again the viewport works fine. i have tried to call oddbviewport->updatedisplay after i have created it but i get the following assertion: source\database\entities\dbviewport.cpp line: 1335 expression: invalid execution does anyone know how to update a viewport without closing the file and open it again? hi, next piece of code appends new viewport to the paper space and adds appropriate view to gs device (it works fine with dd v1.14): code: // pdevice - pointer that setupactivelayoutviews() has returned for this database odgspaperlayouthelperptr ppshelper = odgspaperlayouthelper::cast(pdevice); if(ppshelper.get()) // we are in the paper space { oddbviewportptr pvp = oddbviewport::createobject(); pvp->setheight(10); pvp->setwidth(15); pvp->zoomextents(); odgicontextfordbdatabaseptr pctx = ppshelper->usergicontext(); odgsclientviewinfo viewinfo; pctx->fillgsclientviewinfo(pvp->objectid(), viewinfo); odgsviewptr pview = ppshelper->createview(&viewinfo); ppshelper->addview(pview); ppshelper->initgsview(pview, pvp); pview->add(pctx->database()->getmodelspaceid().safeopenobject(), ppshelper->gsmodel()); } |
所有的时间均为北京时间。 现在的时间是 04:04 AM. |