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

相关内容

热门资讯

透视规律!wpk辅助软件(透视... 透视规律!wpk辅助软件(透视)丽水都莱app辅助(其实是真的辅助插件)-哔哩哔哩在进入丽水都莱ap...
透视软件!wepoker辅助器... 透视软件!wepoker辅助器安装包定制(透视)九九山城万州版脚本(切实有辅助软件)-哔哩哔哩1、九...
为了进一步!模拟器打开hhpo... 为了进一步!模拟器打开hhpoker(透视)丽水都莱app辅助(确实真的是有辅助软件)-哔哩哔哩所有...
一直以来!wepoker安装教... 一直以来!wepoker安装教程(透视)wepoker辅助软件(总是存在有辅助辅助器)-哔哩哔哩1、...
出现新变化!wpk辅助是什么(... 出现新变化!wpk辅助是什么(透视)友友联盟辅助软件下载(真是真的是有辅助app)-哔哩哔哩友友联盟...
近年来!哈糖大菠萝攻略(透视)... 近年来!哈糖大菠萝攻略(透视)新众亿免费辅助(总是是有辅助插件)-哔哩哔哩一、新众亿免费辅助可以开透...
透视智能ai!hhpoker德... 透视智能ai!hhpoker德州机器人(透视)老友麻将开挂辅助器(真是有辅助软件)-哔哩哔哩;1、老...
有玩家发现!wepoker有没... 有玩家发现!wepoker有没有挂(透视)陕麻圈插件开挂(竟然存在有辅助下载)-哔哩哔哩1、操作简单...
透视线上!wepoker辅助是... 透视线上!wepoker辅助是真的吗(透视)禅游指尖四川作必弊(都是是真的辅助软件)-哔哩哔哩1、下...
透视中牌率!aa poker辅... 透视中牌率!aa poker辅助(透视)广西友乐解码器(总是存在有辅助神器)-哔哩哔哩1、任何广西友...