[每日一码] 在AUTOCAD 2015 使用3DPOLY命令中使用回调的代码
回调函数是myTest3DPolyCallback, 主命令函数是MyGroupTestSendCommand3static 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..."));
}
页:
[1]