Autodesk forge 添加图形文档时出现未指定的错误

Autodesk forge 添加图形文档时出现未指定的错误,autodesk-forge,autodesk-designautomation,Autodesk Forge,Autodesk Designautomation,我遇到了一个问题,需要用指定的模板文件打开一个新的图形文件,如下所示 objInventorServer.Documents.Add(Inventor.DocumentTypeEnum.kDrawingDocumentObject,templatePath) 但此行在workitem日志中给出了一个未指定的错误。我想,InventorServer对象出现了问题。 因为在本地机器上与普通的Inventor.Application对象使用同一行时,其工作正常。请帮我解决这个问题。您需要正确指定模板路

我遇到了一个问题,需要用指定的模板文件打开一个新的图形文件,如下所示

objInventorServer.Documents.Add(Inventor.DocumentTypeEnum.kDrawingDocumentObject,templatePath)

但此行在workitem日志中给出了一个未指定的错误。我想,InventorServer对象出现了问题。
因为在本地机器上与普通的Inventor.Application对象使用同一行时,其工作正常。请帮我解决这个问题。

您需要正确指定
模板路径。这必须是本地完整文件名。无法打开此文件。模板必须是输入数据或appbundle的一部分。路径如下所示:T:\Aces\Jobs\9b8d2f73366f47a0b90b8c522bd52b\CadData\Templates\Norma.idw

您需要正确指定
模板路径。这必须是本地完整文件名。无法打开此文件。模板必须是输入数据或appbundle的一部分。路径如下所示:T:\Aces\Jobs\9b8d2f73366f47a0b90b8c52bd52b\CadData\Templates\Norma.idw

仅当图形文件的版本比我运行的Inventor服务器的版本更新时,我才会遇到问题,但随后我收到更多消息:

[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : 
RunWithArguments called
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : Creating 
drawing based on template T:\Aces\Applications\317779a582552210117f0484dd24ec3e.rGm0mO9jVSsD2yBEDk9MRtXQTwsa61y0.SampleBundle[9].package\SampleBundlePlugin.bundle\Contents\Templates\ANSI (in).idw
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : FileExists = True
[05/28/2020 16:23:54]     InventorCoreConsole.exe Error: 0 : Inventor message: This file was saved in a newer version of the product. Inventor can't open newer versions of drawing (.idw, .dwg) and presentation (.ipn) files.
[05/28/2020 16:23:54] To open a part (.ipt) or an assembly (.iam) file one year newer than your current version, install the latest updates.
[05/28/2020 16:23:54] T:\Aces\Applications\317779a582552210117f0484dd24ec3e.rGm0mO9jVSsD2yBEDk9MRtXQTwsa61y0.SampleBundle[9].package\SampleBundlePlugin.bundle\Contents\Templates\ANSI (in).idw (Inventor Server x64 SDK 2020 (Build 240168000, 168))
[05/28/2020 16:23:54] Search in the Inventor help for 'Troubleshooting Opening Newer Files' for information on how to open a newer file.
[05/28/2020 16:23:54]     InventorCoreConsole.exe Error: 0 : Inventor inner xml:
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : Deactivating plug-in: SampleBundlePlugin
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : : SampleBundlePlugin: deactivating...
[05/28/2020 16:23:54] T h e   p a r a m e t e r   i s   i n c o r r e c t .   ( E x c e p t i o n   f r o m   H R E S U L T :   0 x 8 0 0 7 0 0 5 7   ( E _ I N V A L I D A R G ) )
[05/28/2020 16:23:54]

但在这种情况下,“打开”也会失败如果图形文件的版本比我正在运行的Inventor Server的版本更新,我只会遇到问题,但随后我收到了更多消息:

[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : 
RunWithArguments called
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : Creating 
drawing based on template T:\Aces\Applications\317779a582552210117f0484dd24ec3e.rGm0mO9jVSsD2yBEDk9MRtXQTwsa61y0.SampleBundle[9].package\SampleBundlePlugin.bundle\Contents\Templates\ANSI (in).idw
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : FileExists = True
[05/28/2020 16:23:54]     InventorCoreConsole.exe Error: 0 : Inventor message: This file was saved in a newer version of the product. Inventor can't open newer versions of drawing (.idw, .dwg) and presentation (.ipn) files.
[05/28/2020 16:23:54] To open a part (.ipt) or an assembly (.iam) file one year newer than your current version, install the latest updates.
[05/28/2020 16:23:54] T:\Aces\Applications\317779a582552210117f0484dd24ec3e.rGm0mO9jVSsD2yBEDk9MRtXQTwsa61y0.SampleBundle[9].package\SampleBundlePlugin.bundle\Contents\Templates\ANSI (in).idw (Inventor Server x64 SDK 2020 (Build 240168000, 168))
[05/28/2020 16:23:54] Search in the Inventor help for 'Troubleshooting Opening Newer Files' for information on how to open a newer file.
[05/28/2020 16:23:54]     InventorCoreConsole.exe Error: 0 : Inventor inner xml:
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : Deactivating plug-in: SampleBundlePlugin
[05/28/2020 16:23:54]     InventorCoreConsole.exe Information: 0 : : SampleBundlePlugin: deactivating...
[05/28/2020 16:23:54] T h e   p a r a m e t e r   i s   i n c o r r e c t .   ( E x c e p t i o n   f r o m   H R E S U L T :   0 x 8 0 0 7 0 0 5 7   ( E _ I N V A L I D A R G ) )
[05/28/2020 16:23:54]

但在这种情况下,Open也会失败。我使用的模板路径与您建议的相同(来自jobs目录),但仍然发生了错误。使用Open函数而不是Add作为解决方法。我使用了与您建议的相同的模板路径(来自jobs目录),但仍然发生了错误。使用“打开”功能而不是“添加为解决方案”。是的,我使用的是Inventor 2017中的模板文件。在使用Inventor 2018模板(与Forge中使用的版本相同)后,它成功了!没有尝试过这个东西,因为它是用开放式方法工作的。谢谢;)是的,我使用的是Inventor 2017的模板文件。在使用Inventor 2018模板(与Forge中使用的版本相同)后,它成功了!没有尝试过这个东西,因为它是用开放式方法工作的。谢谢;)