马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
回调函数是myTest3DPolyCallback, 主命令函数是MyGroupTestSendCommand3
static int myTest3DPolyCallback(void *pData)
{
if (acedCmdCWasCancelled())
{
acutPrintf(_T("\n3DPoly Command was cancelled..."));
return 0;
}
if (is3DPolyActive())
{
int res = acedCommandC(&myTest3DPolyCallback, NULL, RTSTR, PAUSE, RTNONE);
acedCallBackOnCancel();
acutPrintf(_T("\nmyTest3DPolyCallback: 3DPoly is active. res=%d"), res);
return 1;
}
CallWhen3DPolyDone();
return 0;
}
static Adesk::Boolean is3DPolyActive()
{
struct resbuf rb;
acedGetVar(_T("CMDNAMES"), &rb);
if (_tcsstr(rb.resval.rstring, _T("3DPOLY")))
return Adesk::kTrue;
return Adesk::kFalse;
}
static void CallWhen3DPolyDone()
{
acutPrintf(_T("\n3DPoly Command completed..."));
}
static void MyGroupTestSendCommand3(void)
{
acedCommandC(&myTest3DPolyCallback, NULL, RTSTR, _T("_.3DPOLY"), RTSTR, PAUSE, RTSTR, PAUSE, RTNONE);
acutPrintf(ACRX_T("\nAfter acedCommandC call. acedCommandC is asynchronous..."));
}
|