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

相关内容

热门资讯

3分钟办法!约局吧是否有挂(透... 3分钟办法!约局吧是否有挂(透视)好像存在有辅助辅助(哔哩哔哩)所有人都在同一条线上,像星星一样排成...
8分钟脚本!禅游游戏辅助器,广... 8分钟脚本!禅游游戏辅助器,广麻辅助器(一直有挂辅助app)-哔哩哔哩暗藏猫腻,小编详细说明禅游游戏...
一分钟指南!wpk辅助(透视)... 一分钟指南!wpk辅助(透视)切实有辅助脚本(哔哩哔哩)1、wpk辅助破解器简单,wpk辅助机器人操...
第二分钟安装!奇迹免费自动挂机... 第二分钟安装!奇迹免费自动挂机脚本,决战卡五星辅助ios(都是有挂辅助神器)-哔哩哔哩1、任何奇迹免...
1分钟窍要!wpk软件是正规的... 1分钟窍要!wpk软件是正规的吗(透视)竟然是有辅助透视(哔哩哔哩)1、上手简单,内置详细流程视频教...
5分钟脚本!天天贵阳辅助插件,... 5分钟脚本!天天贵阳辅助插件,三哥玩辅助器(总是是真的辅助app)-哔哩哔哩1、金币登录送、破产送、...
第3分钟机巧!aapoker插... 第3分钟机巧!aapoker插件(透视)都是是有辅助插件(哔哩哔哩)1、第3分钟机巧!aapoker...
十分钟脚本!汇友游戏辅助,福建... 十分钟脚本!汇友游戏辅助,福建天天开心辅助器(真是有挂辅助神器)-哔哩哔哩1、福建天天开心辅助器免费...
第五分钟演示!hhpoker是... 第五分钟演示!hhpoker是正规的吗(透视)其实是真的有辅助工具(哔哩哔哩)1、打开软件启动之后找...
第1分钟插件!逗好乐游辅助器,... 第1分钟插件!逗好乐游辅助器,三哥玩十三张辅助器(都是是有辅助脚本)-哔哩哔哩1、不需要AI权限,帮...