iCAx开思工具箱

标题: 【原创】得到Sw中选择点坐标 [打印本页]

作者: wangao88    时间: 2003-5-29 11:33
标题: 【原创】得到Sw中选择点坐标
得到用鼠标点击物体时,鼠标所点的那个点的坐标(不是屏幕坐标)
LPMODELDOC2       pModelDoc = NULL;
  LPSELECTIONMGR    pSelectMgr = NULL;
  double            retval[3];
  CString           string;
  long        nSelCount = 0;
  
  TheApplication->GetSWApp()->get_IActiveDoc2([$pModelDoc)]
  if (!pModelDoc) return;
  pModelDoc->get_ISelectionManager([$pSelectMgr)]
  if (!pSelectMgr) {
    pModelDoc->Release();
    return;
  }
  pSelectMgr->GetSelectedObjectCount([$nSelCount)]
  if (nSelCount != 0){
    pSelectMgr->IGetSelectionPoint (1, retval);
  }
  string.Format(_T("Selected point (%.2f,%.2f,%.2f)"),retval[0], retval[1],retval[2]);
  AfxMessageBox(string);
  pModelDoc->Release();
  pSelectMgr->Release();  
    return;




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3