-
-
March 19, 2024 at 5:52 pm
Matthew Little
SubscriberI'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.
-
March 20, 2024 at 6:35 am
Aniket
Forum ModeratorHi 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
-
- The topic ‘Automatically load user buttons when Mechanical Opens’ is closed to new replies.
-
3150
-
1013
-
956
-
858
-
797
© 2025 Copyright ANSYS, Inc. All rights reserved.