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透视外挂,(wpK)一直真的是有挂,黑科技实锤(有挂透视)-哔哩哔哩;运wpk透视...
黑科技透视!(WePoKe)原... 黑科技透视!(WePoKe)原先是真的有挂,(wePokE)原来存在有挂,黑科技针对(真是有挂)-哔...
十分钟黑科技!德扑之星记牌器,... 十分钟黑科技!德扑之星记牌器,(德扑之星)往昔是有挂,科技教程(有挂教程)-哔哩哔哩;该软件可以轻松...
透视美元局(AAPOKer)透... 透视美元局(AAPOKer)透视辅助脚本(透视)好像存在有挂(有挂详情)-哔哩哔哩1、ai辅助优化,...
第四分钟辅助挂!微扑克ai辅助... 第四分钟辅助挂!微扑克ai辅助透明挂,(微扑克)都是有挂,是真的有挂(有挂猫腻)-哔哩哔哩1、不需要...
黑科技代打!(WePoKe)从... 黑科技代打!(WePoKe)从来真的有挂,(WEPOke)原来存在有挂,黑科技大厅房(揭秘有挂)-哔...
黑科技辅助!(WePoKe)一... 黑科技辅助!(WePoKe)一贯是有挂,(wepoKe)原来真的有挂,黑科技辅助(有挂秘诀)-哔哩哔...
黑科技有挂!(WePoKe)真... 黑科技有挂!(WePoKe)真是有挂,(WEpoke)原来存在有挂,黑科技苹果版(有挂工具)-哔哩哔...
透视科技(AaPOKER)透视... 透视科技(AaPOKER)透视辅助插件(透视)本来是真的有挂(讲解有挂)-哔哩哔哩1、这是跨平台的黑...
透视安装(aapoKer)透视... 透视安装(aapoKer)透视辅助脚本(透视)最初是有挂(有挂分析)-哔哩哔哩1、很好的工具软件,可...