Before Ansys Mechanical for Workbench was established, engineers depended on a scripting language called Ansys Parametric Design Language (APDL) to set up and run studies. APDL is a powerful tool, and it is still utilized behind the scenes anytime a user develops and solves a model in Ansys Mechanical. While the learning curve is steeper than using the modern Ansys Mechanical user interface, APDL does have some distinct advantages aside from allowing the user a precise degree of control over the analysis, as a scripting language, it also provides for automation of repetitive operations. Users of Ansys Mechanical still have the option of embedding APDL code into their model by putting command snippets into the analysis tree. However, this strategy has significant downsides. Any objects built using a code snippet are formed when the model is solved and are not fully integrated into the Ansys Mechanical environment. Also, APDL was established many years ago and is quite complicated to use. One can easily do ANSYS Online Training.
With the inclusion of scripting into Ansys Mechanical, customers may utilize the contemporary Python programming language to automate an extensive array of activities. Python scripting is highly integrated into the program, and any objects generated or analysis parameters altered may immediately be viewed in the Mechanical GUI. Lines of code may also be instantly stored to a user-defined button in the ribbon for actions performed frequently. There are so many institutes that offer ANSYS Training in Noida.
For this example, they will produce point masses using the supplied arrays of assemblies, coordinates, and mass moments of inertia. A foreword to the encoding words Python is in order.
- In Python, indentation is used to denote a block of code and make it easier to read. Following a control flow statement, an indented block of code specifies all the code that should be performed.
Unlike other programming languages, Python does not need you to define variables and specify their data types.
First, they declare three variables and assign string values for length, mass, and mass moment of inertia.
They define a list variable for each mass and mass moment of inertia to reflect the respective values. There is a first point mass in each list, a second point mass, etc. They’ll generate three-point masses in this example. Students also like to do ANSYS Training in Delhi.
You may then dig down into the mechanical item tree (See below image). Because right-clicking on in the tree adds a point mass in Mechanical, they must utilize the API to access. Adding a new point mass is possible by calling the AddPointMass function. Notice the last parenthesis in Python, which is essential to signify a method in the programming language.
Conclusion
Since they know how to generate a new point mass, they can cycle through the values in the lists defined above and create new point masses using the command. The function enables us to cycle through numerous lists at once, making it easier to keep track of everything. The values are assigned using the “Quantity” type, which allows the amount to alter depending on the unit system used. You should enroll with this institute for ANSYS Workbench Training in Noida.