ACT: drop-down list of analyses as a property of Custom Load Object

dafedin Member Posts: 21
First Anniversary First Comment Name Dropper


In my ACT extension, I need to get a Property for a Custom Load Object with the drop-down list of all Mechanical analyses in Project Tree and the appropriate function to process user action (selection) and get selected analysis inside my ACT main script as Analysis Object.
Is it possible? Does somebody have an example of code?

I would appreciate for help


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

    Hi @dafedin . Not sure I fully understand your question, but maybe this post helps:

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 215
    First Answer First Comment 5 Likes First Anniversary

    Have a look at the Mechanical Template 7 by clicking on the ACT Templates tab here:

    Here is another example where a drop-down lists all named selections containing 2 nodes. In this example we internally use the Tree object's ID, which is what you will likely want to do:

                <property name="Path" caption="Path" control="select" readonly = "false">
    def FillDropDown(result,property):
        named_selections = ExtAPI.DataModel.Components
        for ns in named_selections:
            if ns.SelectionType.ToString() == 'MeshNodes':
                if ns.Ids.Length == 2:
    def v2sPath(load, prop, val):
            #loop over NS list to match ID and then return Name
            named_selections = ExtAPI.DataModel.Components
            for ns in named_selections:
                if ns.Id == int(val):
                    if ns.SelectionType.ToString() == 'MeshNodes' and ns.Ids.Length == 2:
                        return ns.Name
                        #return "NS_INVALID"
                        return ns.Name
            return "NS_DELETED"