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安卓!微扑克插件透视ai... WPK安卓!微扑克插件透视ai,德州透视插件,确实是有ai透视办法1)德州透视插件免费钻石:进一步探...
WPK脚本!红龙PoKer方法... WPK脚本!红龙PoKer方法透视ai,wpk有辅助器吗,本来是有ai透视绝活儿wpk有辅助器吗是不...
WPK下载!aapoker工具... WPK下载!aapoker工具透视挂ai,菠萝德州透视脚本,总是真的有ai透视挂妙招1、全新机制【菠...
WPK德州局!微扑克教程透视挂... WPK德州局!微扑克教程透视挂ai,德州透视是真的吗,一贯存在有ai透视挂机巧德州透视是真的吗透视方...
WPK靠谱!德州扑克脚本透视挂... WPK靠谱!德州扑克脚本透视挂ai,wpk俱乐部怎么作弊,原来存在有ai透视挂积累1、下载好wpk俱...
WPK四人!AApoker教程... WPK四人!AApoker教程辅助ai,德州局透视,总是真的是有ai辅助项目1、这是跨平台的德州局透...
WPK透视版!德州扑克攻略开挂... WPK透视版!德州扑克攻略开挂ai,佛手在线是不是有挂,好像真的是有ai开挂教程书1、打开软件启动之...
WPK真假!智星菠萝德州教程透... WPK真假!智星菠萝德州教程透视挂ai,菠萝德州透视脚本,一贯真的有ai透视挂项目1、玩家可以在菠萝...
WPK链接!红龙扑克方法开挂a... WPK链接!红龙扑克方法开挂ai,wpk辅助是什么,好像是有ai开挂积累1、WPK链接!红龙扑克方法...
WPK真假!红龙扑克软件透视挂... WPK真假!红龙扑克软件透视挂ai,aapoker公共底牌,总是真的有ai透视挂模块1、aapoke...