Ansys Learning Forum › Forums › Installation and Licensing › Ansys Products › Scripting in Mechanical – Accessing ‘Model’ › Reply To: Scripting in Mechanical – Accessing ‘Model’
March 4, 2024 at 1:22 pm
Matthew Little
Subscriber
After a few more searches, I found a solution. In the imported module, you must 'initialize' the Ansys objects you want to use (e.g., ExtAPI, Ansys). Create a function that takes whatever objects you want and set them to global variables in the imported module.
In the main Ansys script, after you load your module, you call the initialization function to pass whatever Ansys namespace functions (ExtAPI, Ansys, etc.) to you module.
This sort of seems like a workaround, and i feel like there should be a direct way to import the needed objects.