-
-
March 2, 2020 at 7:16 pm
senior2020design
SubscriberHello I have been developing ACT extensions for some time now for a school project and I was wondering how I would exactly access the ribbon tabs at the top menu of Ansys Mechanical? The ribbon tabs such as File, View, etc... because I am trying to pop it up with an extension button rather than moving the mouse to click on it. Currently the specific window called Manage Views in Mechanical (open Mechanical>View>Windows>ManageViews) is what I specifically want to prop or pop up with an extension button. I looked through the files to see how this window was developed and I see that most of the functions of the Manage View window is in jScript. My extensions are only scripted in XML and IronPython coding.
Thank you for the help,
DL
-
March 3, 2020 at 11:00 am
Aniket Chavan
Forum ModeratorI believe answering this question would be out of the scope of the student community's guidelines. But, have you checked Wizards? You can create a wizard that can be used for guided workflows.
-Aniket
Guidelines on the Student Community
-
March 3, 2020 at 5:19 pm
senior2020design
SubscriberCan I ask if this is possible, or is this something users of Ansys are not allowed or able to do?
I have looked at the Wizard, but unfortunately that would just be a rundown of guiding a user to find the buttons and etc. Which would be more time consuming than that before.Â
-
March 5, 2020 at 12:15 pm
Aniket Chavan
Forum ModeratorIt should be possible as this must have a JScript call to call this pane in front, but as I've mentioned before, these calls are neither documented nor supported, hence I won't be able to help much. I believe you will have to dig it yourself from the JScript files. I believe the following blogs might be some help in the process:
https://www.padtinc.com/blog/ansys-mechanical-scripting-howto-part-1/
https://www.padtinc.com/blog/ansys-mechanical-scripting-howto-part-2/
http://www.padtinc.com/blog/ansys-mechanical-scripting-howto-part-3/
http://www.padtinc.com/blog/ansys-mechanical-scripting-howto-part-4/
Â
-
March 9, 2020 at 3:50 pm
senior2020design
SubscriberThank you for the response and reference links. It has helped me understand the development of Ansys Mechanical and in finding the location of my goal.Â
Do you know if Ansys has an API that allows Javascript to interact with IronPython without having to include imports in the .py file? Because I know I can utilize a outsourced interpreter such as PyV8 or js2py to have python read a javascript function but the user would have to pip install PyV8 or pip install js2py manually into their computer.
If you do have an idea of such API, would this API exist in the online ANSYS ACT API's for Mechanical reference guide bc I am having trouble finding it in there?
Thank you, DL
-
March 10, 2020 at 12:35 pm
Aniket Chavan
Forum ModeratorPlease check the link:
https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v195/act_script/mech_apis_InteractingWithJScript.html
and let me know if that helps!
-Aniket
Guidelines on the Student Community
-
March 22, 2020 at 10:22 pm
senior2020design
SubscriberThank you for the help. I have been attempting this for a while now, but could not seem to get any interaction to show from Mechanical Interface. This is exactly what I have been looking for... Although it seems more like the link describes ways of passing single data types rather than an entire jscript object or in lack of better words functions.Â
In my .py code I follow the way the link script the jscript functions inside the script = """ ___ """ and then call it using the var returnVal and returnFromScript(____). The error that I have from using this is:
Error: Object expected
Source: Microsoft Jscript runtime error
Script: returnFromScript(____)
 ALSO, do I need to import anything so that my python file knows which jscript file I am reading from in ANSYS?
Thank you
-
March 26, 2020 at 11:14 pm
senior2020design
Subscriber@Aniket
My extension button in Mechanical is scripted with XML calling a python function via onclick button. In the Python file exists a jscript interaction like the one in the link you shared with me. When I comment out the jscript interaction in the python file the button in Mechanical executes and everything runs perfectly. But when I do not comment out the jscript interaction in the python file, all I can do is click my button in Mechanical and nothing happens.Â
Please let me know what could possibly be happening? Do I need to import anything of some sort?
Thank you, DL
-
- The topic ‘Accesssing Ansys Ribbon tabs in Mechanical’ is closed to new replies.
-
5849
-
1906
-
1420
-
1305
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.