void openSyncDocHelper( void *pData) { if (acDocManager->isApplicationContext()) { const TCHAR * fileName = (const TCHAR *)pData; Acad::ErrorStatus es = acDocManager->appContextOpenDocument(fileName); assert(es == Acad::eOk); } else assert(0 && "ERROR: in Document context."); } void writeBlock() { static char pData[] = ( "G:\\HR1.dwg" ); AcApDocument* pDoc = acDocManager->curDocument(); if (pDoc) { acDocManager->closeDocument(pDoc); acutPrintf(_T("\nCurrently in Document context : %s, Switching to App.\n"),pDoc->fileName()); acDocManager->executeInApplicationContext(openSyncDocHelper, (void *)pData); } } 为何无法关闭当前文档 说还有一个命令在运行,请完成该命令,然后重试. 如果把acDocManager->closeDocument(pDoc);放在最后好像可以关闭 但是无法继续运行了 Arx中有没有像vba中的 thisdrawing.Close ture or false 类似的功能函数 |