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

相关内容

热门资讯

aapoker透视辅助!aa ... 1、aapoker透视辅助!aa poker有没有挂,(Aapoker)真是真的是有挂,详细教程(有...
aapoker辅助工具存在!德... aapoker辅助工具存在!德州aa扑克透明挂,(AAPOKEr)都是真的是有挂,详细教程(有挂黑科...
透视软件!哈糖大菠萝能开挂吗,... 透视软件!哈糖大菠萝能开挂吗,聚星ai辅助工具收费多少(原来存在有挂);1、完成聚星ai辅助工具收费...
aapoker挂!aapoke... aapoker挂!aapoker软件app,(AAPoker)一贯是真的有挂,详细教程(有挂了解),...
透视好友!约局吧德州可以透视吗... 透视好友!约局吧德州可以透视吗,竞技联盟辅助(都是真的是有挂)1、不需要AI权限,帮助你快速的进行约...
aapoker透明挂!aa扑克... aapoker透明挂!aa扑克有外挂吗,(AApoker)总是真的是有挂,详细教程(有挂方法);aa...
透视插件!sohoo竞技联盟辅... 透视插件!sohoo竞技联盟辅助器,pokeplus脚本(原来存在有挂);sohoo竞技联盟辅助器辅...
aapoker透明挂!德州aa... 自定义aapoker透明挂系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器,...
透视总结!约局吧德州透视,佛手... 透视总结!约局吧德州透视,佛手在线大菠萝技巧(原来是真的有挂)1、佛手在线大菠萝技巧系统规律教程、佛...
aapoker透视辅助!aap... aapoker透视辅助!aapoker辅助是真的吗,(aapoKer)切实是真的有挂,详细教程(有挂...