Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

Automatically load user buttons when Mechanical Opens

    • Matthew Little
      Subscriber

      I've created several User buttons for Mechanical (Automation/User Buttons) that I want to share with my coworkers.  Is there a way to save these Python scripts somewhere, and whenever someone opens an instance of Mechanical, Ansys reads in the Python scripts and automatically creates the Buttons?

      I'm trying to make it as hands-free as possible so noone has to deal with copying/pasting scripts into the User Button definition every time there is a change in the code.  I currently have it where all a coworker has to do is copy and paste a small script into a user button once, and that small script reloads everything and presents the GUI, but this is starting to get cumbersome to load in with increasing functionallity.  Individual buttons will run smoother.

    • Aniket
      Forum Moderator

      Hi Matthew, you can create an ACT extension out of the code and distribute the binary to the users. You can also install the extension as default so all the buttons will be loaded each time a project is opened.

       

       

       

      I hope you have already gone through the developer's page for ACT, which is used for automation in Mechanical, but if not, kindly check:

      https://catalog.ansys.com/Developers.cshtml

      This link includes the developer's guides, API guides, migration notes, and some templates.

       

      Finally, you can go through the scripting guide for Mechanical:

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/act_script/act_script.html

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/act_cust_mech/act_cust_mech.html

      and for Workbench:

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/wb2_js/wb2_js.html

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/act_cust_wb/act_cust_wb.html

      -Aniket

      Forum Rules & Guidelines

Viewing 1 reply thread
  • The topic ‘Automatically load user buttons when Mechanical Opens’ is closed to new replies.