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();