|
[code]//视口旋转
ads_name ent;
ads_point pt;
if (RTNORM != acedEntSel(_T("\n选择视口: "),ent,pt))
{
return;
}
AcDbObjectId objId=AcDbObjectId::kNull;
Acad::ErrorStatus es = acdbGetObjectId(objId,ent);
AcDbEntity *pEnt=NULL;
es = acdbOpenAcDbEntity(pEnt,objId,AcDb::kForWrite);
if (es != Acad::eOk)
{
return;
}
if (pEnt->isKindOf(AcDbViewport::desc()))
{
AcDbViewport *pViewPort=AcDbViewport::cast(pEnt);
AcGePoint2d ptCenter= pViewPort->viewCenter();
pViewPort->setTwistAngle(pViewPort->twistAngle() + 3.14159265358979323846*0.5);
ptCenter.rotateBy(3.14159265358979323846*0.5);
pViewPort->setViewCenter(ptCenter);
}
pEnt->close();[/code] |
|