这段代码对应了CAD里的什么操作?始终弄不明白,尤其是那些函数里的参数.求哪位看出个所以然的谈谈自己的想法,感激不尽!
void SetVars(int cmd,int bpmd,int fdia, int cmddia) { struct resbuf *cmdRes,*bpmdRes,*fdiaRes, *cmddias;
cmdRes = ads_newrb(RTSHORT); bpmdRes = ads_newrb(RTSHORT); fdiaRes = ads_newrb(RTSHORT); cmddias = ads_newrb(RTSHORT);
cmdRes ->resval.rint = cmd; bpmdRes->resval.rint = bpmd; fdiaRes->resval.rint = fdia; cmddias->resval.rint = cmddia;
ads_setvar("cmdecho",cmdRes); ads_setvar("blipmode",bpmdRes); ads_setvar("filedia",fdiaRes); ads_setvar("cmddia",cmddias);
ads_relrb(cmdRes); ads_relrb(bpmdRes); ads_relrb(fdiaRes); ads_relrb(cmddias); }
void PostAcadCommand(CString theCmdLine) { CWnd * pACad = (CWnd::FromHandle(adsw_acadMainWnd()))->GetTopWindow( );
LPARAM lParam = 0x00190001; int len = theCmdLine.GetLength(); for(int i=0; i<len;i++) { pACad->ostMessage( WM_CHAR, WPARAM(theCmdLine), lParam); } return; }
void CFrameDlg::OnOK() {
csPath = "D:\\1.dwg";
SetVars(0,0,0,1); ads_command(RTSTR, "._tilemode", RTSTR,"0", RTNONE); ads_command(RTSTR,"._pspace",RTNONE); ads_command(RTSTR,"._insert",RTSTR,(LPCTSTR)csPath, RTSTR, "0,0,0", RTREAL,1.0,RTSTR,"",RTSTR,"",RTNONE); ads_command(RTSTR, "._zoom", RTSTR,"_extents", RTNONE); ads_printf("continue MVIEW to insert Model space viewports for output.\n"); SetVars(1,0,1,1);  ostAcadCommand("._mview ");
} |