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有透视辅助!wepoke... wpk有透视辅助!wepoke辅助技巧,(WEPoke)切实是有挂,透明挂教程(有挂教程)1、用户打...
透视安卓版!hhpoker透视... 透视安卓版!hhpoker透视方法,aapoker辅助插件工具下载,一秒答解(有挂总结)1、进入到a...
微扑克wpk透视辅助!wepo... 微扑克wpk透视辅助!wepower有外挂,(wEpOke)总是真的是有挂,分享教程(有挂工具);1...
透视挂透视!aapoker辅助... 透视挂透视!aapoker辅助插件工具下载,wpk辅助购买,实测揭晓(有挂技巧)1、起透看视 aap...
wpk透视辅助!微扑克系统发牌... wpk透视辅助!微扑克系统发牌规律,(wEPoke)原来真的是有挂,扑克教程(有挂方法)1、起透看视...
透视玄学!wepoker辅助器... 透视玄学!wepoker辅助器怎么用,红龙poker辅助,玩家必备攻略(有挂规律)1、系统规律教程、...
wpk辅助挂!aapoker有... wpk辅助挂!aapoker有猫腻,(wEpOke)本来真的是有挂,专业教程(有挂黑科技)1、很好的...
透视好友!aapoker辅助工... 透视好友!aapoker辅助工具免费下载,wpk透视工作室,一秒答解(有挂攻略)小薇(透视辅助)致您...
透视透视!wepoker脚本下... 透视透视!wepoker脚本下载,智星德州菠萝插件官网,必备攻略(有挂方法);1)智星德州菠萝辅助挂...
wepower辅助器!微扑克游... wepower辅助器!微扑克游戏辅助器,(wePOke)其实真的是有挂,安装教程(有挂辅助)1.微扑...