ObjectARX学习笔记(二十一)-----如何获得当前视图向量

Acad::ErrorStatus
getSysVar(LPCTSTR varName, AcGePoint3d& val)
{
    resbuf rb;
    if (acedGetVar(varName, &rb) == RTNORM) {
        ASSERT(rb.restype == RT3DPOINT);
        val.set(rb.resval.rpoint[X], rb.resval.rpoint[Y], rb.resval.rpoint[Z]);
        return(Acad::eOk);
    }
    else
        return(Acad::eInvalidInput);
}

// cheat and get viewdir for current viewport from the system variable
                AcGeVector3d viewdir;
		AcGePoint3d tmpPt;
		getSysVar(_T("viewdir"), tmpPt);
		viewDir = tmpPt.asVector();

你可能感兴趣的:(ObjectARX)