25 Aug 2020

Design Automation for Inventor VS template - local debug

I wrote before about the Visual Studio project template for Design Automation for Inventor
This time I’ll show you how its project that helps with local debugging can be used.

This project is called "DebugPluginLocally". Inside the DebugSamplePlugin() function you can see all that’s happening to provide the AppBundle code and its RunWithArguments() function everything that would be available on the Design Automation server.

It creates a copy of the source file (box.ipt), so that each time you debug your project locally you start with the exact same document. Then it opens the document in Inventor and passes its Document object to the RunWithArguments() function.

It also provides the full path of the params.json file (that contains the information about all the parameters that should be changed in the Inventor document) inside the map object as the first item with key "_1".

When running the same AppBundle on Design Automation, the path of this json file would be passed as part of the commandLine string of the Activity. Something like this: "$(engine.path)\\InventorCoreConsole.exe /al $(appbundles[UpdateIPTParam].path) $(args[inputJson].path)"

You can find more info here on how the command line arguments can be accessed in the AppBundle.

If there are any changes in how the Activity is set up, you just have to make sure that you modify the DebugSamplePlugin() function accordingly, so that the AppBundle can run the same way, no matter if as part of local debugging or on the Design Automation server.

Related Article