Migrating ACT extension: error message with CreateLoadObject()

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

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?

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    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:

    Once the extension is refreshed in Mechanical, the error disappears, and clicking on the toolbar button does insert the custom object: