I'm migrating an ACT extension to a newer version of Ansys and I'm getting an error message that CreateLoadObject() takes 2 arguments and only 1 was given: How do I resolve this?
CreateLoadObject() method used to take only one argument: the name of the object to be inserted:
The name of the object that is inserted is defined in the .xml file of the extension:
Now CreateLoadObject() method takes 2 arguments: the name of the custom object that will be inserted, and a reference to the extension. To resolve the error message, add ExtAPI.ExtensionManager.CurrentExtensionas second argument:
ExtAPI.ExtensionManager.CurrentExtension
Once the extension is refreshed in Mechanical, the error disappears, and clicking on the toolbar button does insert the custom object: