www.mxdraw.com
|
返回当前的活动视口id
virtual McDbObjectId getAcitveViewportId() const = 0;
返回当前的活动视口id
例如:得到视口,并把显示坐标旋45度
void CCommandManager::DViewTW45() { // if(!Mx::ActiveArxDoc()->IsModelSpace() ) { acutPrintf(_T("n 视图的旋转命令只能在模形空间中使用")); return ; } McDbDatabase* pDatabase = Mx::mcdbHostApplicationServices()->workingDatabase(); // 得到当前视口的id. McDbObjectPointer<McDbViewportTableRecord> spViewport(pDatabase->GetDocument()->getAcitveViewportId(), McDb::kForWrite); if(spViewport.openStatus() != Mcad::eOk) { return; } double dAng = spViewport->viewTwist(); dAng = dAng + PI / 4.0; if(dAng > 2PI) { dAng = fmod(dAng,2PI); } if(MxT::IsEqual(dAng,2PI,0.0001) ) { dAng = 0.0; } spViewport->setViewTwist(dAng); }