david8888 发表于 6 天前

EXPORTLAYOUT命令导出

    wchar_t szFullPath;
    swprintf_s(szFullPath, L"%ls.dwg", szOutputBase);
    acutPrintf(L"\n 正在导出布局 %ls -> %ls", wszLayoutName, szFullPath);
    struct resbuf* cmdList = acutBuildList(
      RTSTR, L"_.EXPORTLAYOUT",
      RTSTR, szOutputBase,   // 文件名,不含 .dwg
      RTNONE);
    if (cmdList) {
      acDocManager->lockDocument(pDoc, AcAp::kWrite);
      int nRet = acedCmdS(cmdList);
      acutRelRb(cmdList);

      if (nRet == RTNORM) {
            if (GetFileAttributesW(szFullPath) != INVALID_FILE_ATTRIBUTES) {
                nLayoutCount++;
                acutPrintf(L"\n 导出成功");
            }
            else {
                acutPrintf(L"\n 命令成功但文件未创建");
            }
      }
      else {
            acutPrintf(L"\n 导出失败,错误码: %d", nRet);
      }
    }
    else {
      acutPrintf(L"\n 无法构建命令列表");
    }
}

想在用OBJECTARX里用EXPORTLAYOUT命令导出图纸,请问为什么这样导出图纸是不行的?有没有大佬指点一下该用什么代码或函数导出比较好? 不要wblock,因为无法导出视口内的图形。
正在导出布局 布局1 -> C:\Users\Davidtwo.DESKTOP-JE552H0\Pictures\test1_布局1.dwg
导出失败,错误码: -5001

david8888 发表于 6 天前

求大佬指点,问了Ai改来改去还是不成功
页: [1]
查看完整版本: EXPORTLAYOUT命令导出