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

相关内容

热门资讯

记者揭秘!智星菠萝辅助(透视辅... 记者揭秘!智星菠萝辅助(透视辅助)拱趴大菠萝辅助神器,扑克教程(有挂细节);模式供您选择,了解更新找...
一分钟揭秘!约局吧能能开挂(透... 一分钟揭秘!约局吧能能开挂(透视辅助)hhpoker辅助靠谱,2024新版教程(有挂教学);约局吧能...
透视辅助!wepoker模拟器... 透视辅助!wepoker模拟器哪个好用(脚本)hhpoker辅助挂是真的,科技教程(有挂技巧);囊括...
透视代打!hhpkoer辅助器... 透视代打!hhpkoer辅助器视频(辅助挂)pokemmo脚本辅助,2024新版教程(有挂教程);风...
透视了解!约局吧德州真的有透视... 透视了解!约局吧德州真的有透视挂(透视脚本)德州局HHpoker透视脚本,必胜教程(有挂分析);亲,...
六分钟了解!wepoker挂底... 六分钟了解!wepoker挂底牌(透视)德普之星开辅助,详细教程(有挂解密);德普之星开辅助是一种具...
9分钟了解!wpk私人辅助(透... 9分钟了解!wpk私人辅助(透视)hhpoker德州透视,插件教程(有挂教学);风靡全球的特色经典游...
推荐一款!wepoker究竟有... 推荐一款!wepoker究竟有透视(脚本)哈糖大菠萝开挂,介绍教程(有挂技术);囊括全国各种wepo...
每日必备!wepoker有人用... 每日必备!wepoker有人用过(脚本)wpk有那种辅助,线上教程(有挂规律);wepoker有人用...
玩家必备教程!wejoker私... 玩家必备教程!wejoker私人辅助软件(脚本)哈糖大菠萝可以开挂,可靠技巧(有挂神器)申哈糖大菠萝...