|
ads_queueexpr( _T(“(command/”_POINT/” /”1,1,0/”)”) );该函数CAD未公开,使用时提前声明下就可以了。可以参考帮助文件中:Tips and Techniques 。
acDocManager->sendStringToExecute(curDoc(), _T(“_POINT 2,2,0 “));该函数在Arx帮助中有详细说明。
acedCommand(RTSTR, _T(“_POINT”), RTSTR,_T(“5,5,0”), RTNONE);
Windows API 方法
void SendCmdToAcad(ACHAR *cmd)
{
COPYDATASTRUCT cmdMsg;
cmdMsg.dwData = (DWORD)1;
cmdMsg.cbData = (DWORD)(_tcslen(cmd) + 1) * sizeof(ACHAR);
cmdMsg.lpData = cmd;
SendMessage(adsw_acadMainWnd(), WM_COPYDATA, NULL, (LPARAM)&cmdMsg);
}
Com 方法
void SendCommandTest(void)
{
IAcadApplicationPtr pApp = acedGetIDispatch(TRUE);
IAcadDocumentPtr pDoc;
pApp->get_ActiveDocument(&pDoc);
pDoc->SendCommand( _T(“_POINT 4,4,0 “) );
} |
|