How can be a custom button with some UI can be added to Ansys Workbench

Options
surajsalvi
surajsalvi Member Posts: 5
First Comment

I want to customize the Ansys Workbench UI to add a tab and button as shown below :

When I click to Custom Button it should open another custom window as shown below and I can able to provide some action to button click :


How this can be done ?

Answers

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 117
    First Answer First Comment First Anniversary Ansys Employee
    admin
    Options

    Hello, @AKD-Scripting-Team might be able to take a look and help.

  • Pierre Thieffry
    Pierre Thieffry Member, Moderator, Employee Posts: 98
    First Anniversary Ansys Employee Solution Developer Community of Practice Member Photogenic
    Options

    Hi @surajsalvi , for the button creation, I recommend you check this discussion https://discuss.ansys.com/discussion/1243/how-to-create-custom-buttons-on-wb-project-page

    For the custom window, I believe there could be different solutions. What should this window do? Could you elaborate a little more on your need?

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

    For the custom button, you should use ACT as Pierre explained. For the custom window, you can use any option supported by IronPython. If you only need to run on Windows, many people choose to use Windows Forms. For example:

    import clr
    clr.AddReference('System.Windows.Forms')
    from System.Windows.Forms import Application, Form
    class HelloWorldForm(System.Windows.Forms.Form):
        def __init__(self):
            self.Text = 'Hello World'
            self.Name = 'Hello World'
    form = HelloWorldForm()
    form.ShowDialog()