So this is just a quick post to point out a handy feature in ANSYS Workbench, the ACT Console. There are times when you want some functionality in Mechanical that just is not yet there. In this example, a customer wanted the ability to get a text list of all the Named Selections in his model. A quick Python script does just that.
So to use a piece of Python code, like this, we use the ACT Console in Mechanical. To access the ACT Console in Mechanical 17.0, or later, just hit this icon in the toolbar.
The Console allows you to type, or paste, text directly into the black command line at the bottom. But if we are going to reuse this code, then the use of Snippets is the way to go. In R17.0 they were called ‘Bookmarks’, but they worked the same way.
When you add a Snippet, a new window allows you to name the snippet and type in, or paste in, your code.
When you hit Apply, your named snippet is added to the list
From then on, to use the snippet you just click on it, and hit ‘Enter’. The text is basically, repasted into the command window, so you can set any variables needed prior to hitting your snippet.
The snippets are persistent and remain in the console, so they are available for all new projects. Using snippets is a great way to reduce time for repetitive tasks, without having to create a full blown ACT extension.