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透明挂!wepo... aapoker透明挂!wepower德州扑克,WePoke本来真的有挂,2025教程(有挂揭秘)是一...
德州之星外挂!wpk有长期盈利... 1、德州之星外挂!wpk有长期盈利玩家,wpk到底有外挂(详细透视挂教程)2、进入游戏-大厅左侧-新...
wpk辅助挂!wpk俱乐部有a... wpk辅助挂!wpk俱乐部有ai(Wpk)一贯真的有挂-详细透视辅助教程;1、玩家可以在wpk软件透...
德扑之星有猫腻!德扑ai代打会... 德扑之星有猫腻!德扑ai代打会检测到,来玩德州app切实是真的有挂(详细作弊教程)1、打开德州pok...
wepoke ai辅助!wep... wepoke ai辅助!wepoke保险(辅助挂)WEpoke(其实真的有挂);超受欢迎的WEpok...
wpk辅助挂!wpk微扑克智能... 《wpk辅助挂软件透明挂》是一款多人竞技的wpk辅助挂辅助透视游戏,你将微扑克对手来到同一个战场,为...
德州AI智能辅助机器人!德扑分... 德州AI智能辅助机器人!德扑分析软件,线上wpk德州好像有挂(详细外 挂教程)1、实时德州AI智能辅...
wpk透视辅助!WPk果真真的... 您好,WPK这款游戏可以开挂的,确实是有挂的,需要了解加微【757446909】很多玩家在这款游戏中...
AI教程!wepooke系统规... AI教程!wepooke系统规律(wepoke辅助技巧)wEPoke(都是真的有挂);(需添加指定薇...
德州ai辅助!德州ai辅助神器... 德州ai辅助!德州ai辅助神器软件,德扑平台其实真的是有挂(详细ai人工智能教程)是一款可以让一直输...