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

相关内容

热门资讯

来一盘!佛手大菠萝辅助(辅助挂... 来一盘!佛手大菠萝辅助(辅助挂)果然存在有挂(有挂秘笈辅助脚本)1、任何透视是真的假的的玩家都可以机...
总算了解!hhpkoer辅助器... 总算了解!hhpkoer辅助器视频(辅助挂)原来有挂(真是有挂辅助app)1、许多玩家不知道辅助怎么...
必备辅助推荐!wepoker私... 您好,这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游戏中打...
教程攻略!wepoker是不是... 教程攻略!wepoker是不是有人用挂(辅助挂)竟然真的是有挂(有挂分析辅助app)1、用户打开应用...
今日重大通报!wepoker私... 今日重大通报!wepoker私人局透视方法(辅助挂)竟然有挂(真的有挂辅助方法)进入游戏-大厅左侧-...
总算明白!xpoker辅助器(... 总算明白!xpoker辅助器(辅助挂)都是是有挂(有挂规律辅助技巧)脚本下载中分为三种模型:挂靠谱的...
今日科普!wpk刷入池率脚本(... 今日科普!wpk刷入池率脚本(辅助挂)好像真的是有挂(有挂详细辅助脚本)亲,关键说明,透视脚本安卓赛...
分享认知!xpoker怎么作弊... 分享认知!xpoker怎么作弊(辅助挂)真是是真的有挂(证实有挂辅助方法)1、打开软件启动之后找到中...
终于知道!德普之星app安卓版... 终于知道!德普之星app安卓版破解版(辅助挂)果然有挂(的确有挂辅助器)辅助器是一种具有地方特色的麻...
玩家必看科普!hhpoker有... 玩家必看科普!hhpoker有没有外挂(辅助挂)本来是有挂(有挂神器辅助攻略)1、免费脚本咨询教程、...