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

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: 183
    100 Comments 5 Answers First Anniversary Ansys Employee
    admin

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

  • Pierre Thieffry
    Pierre Thieffry Member, Moderator, Employee Posts: 107
    25 Answers Second Anniversary 10 Comments 25 Likes
    ✭✭✭✭

    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, GitHub-issue-creator Posts: 319
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    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()