Get text output of a TUI command #1407
-
Hi, I would like to get, in a python script, the output of a TUI command. For example, the command "define/boundary-conditions/modify-zones/list-zones" prints, in the Fluent GUI, a list of all the model's zones. From pyfluent, the equivalent is solver.tui.define.boundary_conditions.modify_zones.list_zones(). Is it possible to get as a python string the list of zones that is printed in the Fluent GUI when this command is executed? Thanks in advance. EDIT: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
@mkundu1 this seems like it would be nice to have. |
Beta Was this translation helpful? Give feedback.
-
Following is tested on the main branch:
|
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks a lot! I tested your original solution using the class CaptureTranscript and the solution proposed after the edit and both work well. Small detail in the original solution: in the exit method we should have self._solver.tui instead of solver.tui right? |
Beta Was this translation helpful? Give feedback.
-
Hi This method is not working in 2024R2. Please help me. #code -----------------------------------------
TypeError Traceback (most recent call last) TypeError: 'generator' object does not support the context manager protocol |
Beta Was this translation helpful? Give feedback.
-
Hello! Thanks for @mkundu1 ! It helped me a lot. But it seems that this scripts do now work for Fluent with version 2024. Has anyone tried it in the newset version of Fluent? I am afraid that in v23.1 and v23.2, it worked, however, failed in v24.1. There is no errors but variable transcript is an empty string. |
Beta Was this translation helpful? Give feedback.
Following is tested on the main branch: