Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Accesssing Ansys Ribbon tabs in Mechanical

    • senior2020design
      Subscriber

      Hello 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

    • Aniket Chavan
      Forum Moderator

      I 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


      How to access ANSYS help links

    • senior2020design
      Subscriber

      Can 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. 

    • Aniket Chavan
      Forum Moderator

      It 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/


       

    • senior2020design
      Subscriber

      Thank 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

    • Aniket Chavan
      Forum Moderator

      Please 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


      How to access ANSYS help links

    • senior2020design
      Subscriber

      Thank 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

    • 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

Viewing 7 reply threads
  • The topic ‘Accesssing Ansys Ribbon tabs in Mechanical’ is closed to new replies.
[bingo_chatbox]