AutodeskForgeDesignAutomation导出Inventor.Dwg至AutoCAD.Dwg出错
创始人
2024-11-12 10:00:27
0

当使用Autodesk Forge Design Automation导出Inventor格式的.DWG文件至AutoCAD格式的.DWG文件时,可能会遇到以下错误:

System.IO.FileNotFoundException: Could not find file 'C:\.dwg'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, 
Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions 
options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, 
Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, 
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean 
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, 
FileShare share, Int32 bufferSize)
at Autodesk.Forge.DesignAutomation.Inventor.Utils.DwgUtils.ExportIdwToDwg(String 
idwPath, String dwgPath)

此问题的根本原因为无法找到指定路径下的Dwg文件。解决此问题,最简单的方法是确保在导出操作开始时,指定的Dwg文件是存在于该路径下的。此外,还可以进行以下步骤:

  1. 使用正确的参数调用ExportIdwToDwg方法。

  2. 在执行ExportIdwToDwg方法之前,检查文件是否存在,以避免上述错误。

示例代码:

const string inputFile = "inputFile.idw";  // 将“inputFile.idw”替换为实际的文件名
const string inputFolder = "inputFolder";  // 将“inputFolder”替换为实际的文件路径
const string outputFolder = "outputFolder";  // 将“outputFolder”替换为实际的输出文件夹路径

string inputFilepath = Path.Combine(inputFolder, inputFile);
if (File.Exists(inputFilepath))
{
    using (var inventor

相关内容

热门资讯

透视挂透视!aapoker怎么... 透视挂透视!aapoker怎么提高中牌率(透视)透视脚本下载(一贯是有挂)一、aapoker怎么提高...
透视透视!德普之星透视辅助插件... 透视透视!德普之星透视辅助插件(透视)app安卓版破解版(真是是有挂)1、完成德普之星透视辅助插件的...
透视好友!aapoker辅助插... 透视好友!aapoker辅助插件工具(透视)发牌逻辑(确实存在有挂)1、下载好aapoker辅助插件...
透视教程!德普之星透视辅助软件... 透视教程!德普之星透视辅助软件下载(透视)透视(都是是有挂);一、德普之星透视辅助软件下载软件透明挂...
透视透视!aapoker ai... 透视透视!aapoker ai插件(透视)透视脚本下载(确实是有挂)1、aapoker ai插件透视...
透视科技!德普之星的辅助工具介... 透视科技!德普之星的辅助工具介绍(透视)私人局透视(确实有挂)1、全新机制【德普之星的辅助工具介绍软...
透视教学!aapoker免费透... 透视教学!aapoker免费透视脚本(透视)透视方法(切实是真的有挂)1)aapoker免费透视脚本...
透视肯定!德普之星辅助器怎么用... 透视肯定!德普之星辅助器怎么用(透视)私人局透视(切实有挂);1、透视肯定!德普之星辅助器怎么用(透...
透视实锤!aapoker如何设... 透视实锤!aapoker如何设置胜率(透视)辅助(都是有挂)1、不需要AI权限,帮助你快速的进行aa...
透视工具!德扑圈透视(透视)辅... 透视工具!德扑圈透视(透视)辅助器(一贯是有挂);1、进入游戏-大厅左侧-新手福利-激活码辅助透视技...