Does design automation run your plugin in an Inventor process?

111 Views Asked by At

I am using the Design Automation for Inventor template to convert my add in to a plugin for use with Autodesk Platform Services (APS). I have setup my addin and DebugPluginLocally for use with the template. Everything runs and I can see log traces correctly when I call DebugPluginLocally. However, it is slower that loading my addin to Inventor and calling it from within Inventor.

I believe that DebugPluginLocally is running my .dll out-of-process, so that each time I invoke an Inventor object it makes an out-of-process call. Is this hypothesis correct? More importantly, will APS also run my activity out-of-process? With all else equal, like physical machine specs, can I expect that the processing time of my .dll in DebugPluginLocally will be similar to the processing time of APS (ignore file download/upload time ofcourse).

P.S., the code in DebugPluginLocally that calls my add-in is as follows

static void Main(string[] args)
{
    using (var Inv = new InventorConnector())
    {
        InventorServer Server = Inv.GetInventorServer();

        Console.WriteLine("Running locally...");

        // get the test file
        string ProjectDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;
        string FilePath = System.IO.Path.Combine(ProjectDir, @"Inputs\", "TestFile.ipt");
        Document Doc = Server.Documents.Open(FilePath);

        // run the plugin
        MySamplePlugin.PluginServer plugin = new MySamplePlugin.PluginServer(Server);
        plugin.Run(Doc);
    }
}

P.P.S., I have built my add-in using Autodesk Inventor AddIn SDK that copies the build files to the appropriate locations so that Inventor recognizes the addin .dll. Then, I removed all traces of the addin, and instead used Desgin Automation for Inventor template to generate the bundle and DebugPluginLocally to run it. I expected the time to process my code to be similar, but using Design Automation was much slower.

2

There are 2 best solutions below

0
TheWaningMoon On BEST ANSWER

In APS, both InventorServer and the app bundle will run in InventorCoreConsole (in-process). The code for DebugPluginLocally runs out-of-process and is expected to be slower than the APS implementation.

Note that processing time for the APS implementation may be slower or faster than the app being run in an Inventor process on a developer PC, based on machine specs etc.

2
Michal Vasicek On

I believe that DebugPluginLocally is running my .dll out-of-process, so that each time I invoke an Inventor object it makes an out-of-process call. Is this hypothesis correct?

Yes

With all else equal, like physical machine specs, can I expect that the processing time of my .dll in DebugPluginLocally will be similar to the processing time of APS (ignore file download/upload time ofcourse).

Let me elaborate more on "With all else equal, like physical machine specs". You cannot affect what machine is going to be used on APS for processing of your Workitem. APS for Inventor have 1 type of machine used for any Workitem. In case you would have the same spec as local machine, than YES, startup time is going to be faster.

I expected the time to process my code to be similar, but using Design Automation was much slower.

Cloud machines we are using are usually not that powerful as developers desktop computers. Power of running the Workitems in APS lies in

  • parallel computing
  • accesibillity from browser (imagine triggering jobs from public website)