Hello everyone,
I have an Ansys Mechanical (24R2) project that uses a bunch of scripts. As they are fundamental to the information that is generated, I would like to add them to a project report, and have this be as accessible as possible to its readers.
In the scripting editor, the script is given colors to make it more legible. That's just automatic formatting of the editor, though. Not something inherent to the script.
I initially copy-pasted the code as a figure from the editor. However, the scripting editor doesn't really have a word wrap option. So that copy-pasting of code is hard when portions of lines run out of the visible bounds. And the amount has code I'm dealing with has grown to the point this method is no longer really workable.
.
Does anyone know of an easy way to convert an Ansys Mechanical python scripts to some other text format and have it be colored as it is in the scripting editor? And perhaps word wrapped automatically where necessary too, possibly with line breaks (" \") at convenient locations (spaces, interpunction symbols, slashes etc.) as to keep everything readable?
There has to be an easier way than copying the code bit-by-bit from my monitor for my report, or manually going over everything to insert line-breaks so it will fit normal page width when copy pasted as a figure.
Any help with exporting/modifying scripts like this will be appreciated. Thanks in advance.