0

When I run a work item on the DA, I get the following reporting:

[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.

Usually, the error occurs after opening the zip file. I'm wondering if I'm specifying inputs incorrectly, or if the server is crashing because it's trying to run the iLogic plugin?

The following are the activity specs. Zip file is specified for input and output.

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 } }
}

};

These are the workitem parameters. Are there any items that should be specified missing?

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 }}};
Kate
  • 61
  • 6

1 Answers1

0

Thanks for your command line. If I understand correctly you are trying to send zipped file which you would like to have unzipped before opening one of contained file in Inventor. In that case you have to specify name of contained file (because zip can contains more than one file). You can choose name of the file by adding attribute PathInZip to your inputFile argument in WorkItem definition. Like this:

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"
};
  • With the PathInZip parameter, it seems as though it's adding the string twice when trying to open the filepath, and I'm getting a new error: PathInZip = "Jet_Engine_Model\\Jet Engine Model\\Workspace\\_Jet Engine Model.iam", `InventorCoreConsole.exe Information: 0 : Opening document: T:\Aces\Jobs\637648f934c24e48b2f1e64d31b34506\Jet_Engine_Model\Jet Engine Model\Workspace\_Jet Engine Model.iam\Jet_Engine_Model\Jet Engine Model\Workspace\_Jet Engine Model.iam [07/24/2019 21:28:24] The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))` – Kate Jul 24 '19 at 21:30
  • In the command line argument, the extension was originally specified as ipt. If I'm downloading a zip, and opening an iam, should the extension be different? Iam perhaps? EDIT: It looks like it's unpacking TO the PathInZip, and then trying to open the PathInZip from the unpacked folder, which is causing the redundancy in the path. In my command file for the DA, I specify which file to open, so should I be able to skip the PathInZip argument? – Kate Jul 24 '19 at 21:37
  • _it's adding the string twice when trying to open the filepath._ Yes It is, but it is not an issue. I played with Zip files little bit yesterday and I think you have wrong PathInZip. PathInZip was working for me fine. Then I tried to make mistake in PathInZip value and I got exact error you have. Can you please check that your PathInZip valuecorresponds to the reality? – Michal Vasicek Jul 25 '19 at 11:56