iCAx开思工具箱

标题: 如何根据路径名来打开图纸 望指教 [打印本页]

作者: illuminiti    时间: 2011-11-23 10:10
标题: 如何根据路径名来打开图纸 望指教
如题,查找并试了一些方法:
1)static char pData[] = "E:\\图纸\\autoCAD\\test.dwg";
    acDocManager->executeInApplicationContext(OpenDoc, (void *)pData);
void OpenDoc( void *pData)
{
AcApDocument* pDoc = acDocManager->curDocument();
if (acDocManager->isApplicationContext())
{
  acDocManager->appContextOpenDocument((const ACHAR *)pData);  
}
else
{
  //acutPrintf("\nERROR To Open Doc!\n");
}
}
2)LPCSTR lpDocPath= "E:\\图纸\\autoCAD\\test.dwg";
LPDISPATCH pAcadDisp = acedGetIDispatch(TRUE);
hr = pAcadDisp->QueryInterface(AutoCAD::IID_IAcadApplication,(void**)&pAcad);
pAcad->get_Documents(&pDocs);
VARIANT vReadOnly,vPassWord;
VariantInit(&vPassWord);
VariantInit(&vReadOnly);
hr = pDocs->Open((BSTR)lpDocPath,vReadOnly,vPassWord,&pDoc);
3)
Acad::ErrorStatus g = acDocManagerPtr()->appContextOpenDocument((ACHAR *)lpDocPath);
4)
Acad::ErrorStatus  s;
s = acedSyncFileOpen((ACHAR *)lpDocPath);
调试了 都没有打开指定文档,返回值是eNotApplicable
请问如何能够正确打开指定路径图纸,望指点!谢谢





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