0

当我在 DA 上运行工作项时,我得到以下报告:

[07/24/2019 17:50:39] InventorCoreConsole.exe Information: 0 : Loading plug-in: iLogic Plugin
[07/24/2019 17:50:39]     InventorCoreConsole.exe Information: 0 : Activating plug-in: iLogic Plugin
[07/24/2019 17:50:41]     iLogic Plugin: initializing...
[07/24/2019 17:50:43] Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
[07/24/2019 17:50:43] InventorCoreConsole.exe Information: 0 : Opening document: T:\Aces\Jobs\66472a1ecb0f4612a610127e9e0ee497\Jet_Engine_Model.zip
[07/24/2019 17:50:43] 
[07/24/2019 17:50:43] The process 1788 ended.
[07/24/2019 17:50:43] Process exit code: -1
[07/24/2019 17:50:44] 
[07/24/2019 17:50:44] End Inventor Core Engine standard output dump.
[07/24/2019 17:50:44] Error: InventorCoreConsole.exe exits with code -1 which indicates an error.
[07/24/2019 17:50:44] End script phase.
[07/24/2019 17:50:44] Error: An unexpected error happened during phase CoreEngineExecution of job.

通常,错误发生在打开 zip 文件后。我想知道我是否错误地指定了输入,或者服务器是否因为试图运行 iLogic 插件而崩溃?

以下是活动规格。Zip 文件被指定用于输入和输出。

Activity activitySpec = new Activity()

{

Id = activityName,
Appbundles = new List<string>() { string.Format("{0}.{1}+{2}", NickName, appBundleName, Alias) },
CommandLine = new List<string>() { commandLine },
Engine = engineName,
Parameters = new Dictionary<string, Parameter>()
{
    { "inputFile", new Parameter() { Description = "input file", LocalName = "Jet_Engine_Model.zip", Ondemand = false, Required = true, Verb = Verb.Get, Zip = true } },
    { "inputJson", new Parameter() { Description = "input json", LocalName = "params.json", Ondemand = false, Required = false, Verb = Verb.Get, Zip = false } },
    { "outputFile", new Parameter() { Description = "output file", LocalName = "Jet_Engine_Model.zip", Ondemand = false, Required = true, Verb = Verb.Put, Zip = true } }
},
Settings = new Dictionary<string, ISetting>()
{
    { "script", new StringSetting(){ Value = engineAttributes.script } }
}

};

这些是工作项参数。是否有任何应指定缺失的项目?

XrefTreeArgument inputFileArgument = new XrefTreeArgument()
{
Verb = Verb.Get,
Url = string.Format("https://developer.api.autodesk.com/oss/v2/buckets/{0}/objects/{1}", bucketKey, "Jet_Engine_Model.zip"),

Headers = new Dictionary<string, string>(){{ "Authorization", "Bearer " + oauth.access_token }}};

// 2. input json
dynamic inputJson = new JObject();
inputJson.length = lengthParam;
inputJson.numberOfFairings = fairingsParam;
XrefTreeArgument inputJsonArgument = new XrefTreeArgument(){
Verb = Verb.Get,
Url = "data:application/json, " + ((JObject)inputJson).ToString(Formatting.None).Replace("\"", "'")};

// 3. output file
//string outputFileNameOSS = string.Format("{0}_output_{1}", 
DateTime.Now.ToString("yyyyMMddhhmmss"), 
Path.GetFileName(input.inputFile.FileName)); // avoid overriding
XrefTreeArgument outputFileArgument = new XrefTreeArgument(){
Url = string.Format("https://developer.api.autodesk.com/oss/v2/buckets/{0}/objects/{1}", bucketKey, "Jet_Engine_Model.zip"),
Verb = Verb.Put,
Headers = new Dictionary<string, string>(){{"Authorization", "Bearer " + oauth.access_token }}};
4

1 回答 1

0

感谢您的命令行。如果我理解正确,您正在尝试发送您希望在 Inventor 中打开包含的文件之一之前解压缩的压缩文件。在这种情况下,您必须指定包含文件的名称(因为 zip 可以包含多个文件)。您可以通过将属性 PathInZip 添加到 WorkItem 定义中的 inputFile 参数来选择文件的名称。像这样:

XrefTreeArgument inputFileArgument = new XrefTreeArgument()
{
    Verb = Verb.Get,
    Url = string.Format("https://developer.api.autodesk.com/oss/v2/buckets/{0}/objects/{1}", bucketKey, "Jet_Engine_Model.zip"),
    Headers = new Dictionary<string, string>(){{ "Authorization", "Bearer " + oauth.access_token }},
    PathInZip = "FileNameInsideZip.ipt"
};
于 2019-07-24T20:29:53.487 回答