| User Forum
Other Brands
Printing to Console in Flownex
Console printouts are an easy and accessible way to add transparency to specific properties during a simulation. Printing to the console allows you to quickly track convergence across multiple steady state iterations while using a designer.
Thanks for the interesting post! In my case, I want to output to the console not only during the simulation, but also when executing something under ' HandleObjectEvent'. In this case, the IPS.Task.ConsoleSolverOutputProvider.GetConsoleOutputWindow().AddTextLine("text") function does not seem to print anything to the console (for debugging and informing the user about what is happening in the script). Do you know how I can access the console when not executing the solver? Thanks in advance for your help!
Thanks for your post!
You will need to refresh the console after printing to console when the solver is inactive. Below is an example of an override for the HandleObjectEvent() method to print to console with an event (push button):
public override void HandleObjectEvent(object sender)
{
// Clear console - This line may optionally be used to clear the Console prior to printing
IPS.Task.ConsoleSolverOutputProvider.GetConsoleOutputWindow().Clear();
// Write to console - This will write a lien to the console
IPS.Task.ConsoleSolverOutputProvider.GetConsoleOutputWindow().AddTextLine("Console output here...");
// Refresh console - You will need this to view lines printed to the console
IPS.Task.ConsoleSolverOutputProvider.GetConsoleOutputWindow().RefreshTextbox();
}
You can also use a quick script to expose values through instance variables (see attached image) - in addition to third party debugging.
These are variables relatively easy to setup, read, and the constructors may be copy/pasted to a script component.
this solution works, thank you very much!
So far, I have used the Windows message box with "System.Windows.Forms.MessageBox.Show("Output");", which can be dangerous if there are too many outputs e.g. in a loop.
- 7 Categories
- 48 Topics
- 56 Posts
- 0 Online
- 47 Members
Latest posts on Flownex from PADT’s Blog
- An Independence Day Brisket Analysis July 5, 2024
- Flownex Version Control with GIT Client May 31, 2024
- What’s New in Flownex SE (2023 – Update1)? December 22, 2023
- Flownex Student Rocketry Highlights December 15, 2023
- Borrowing a Flownex License December 8, 2023
- Using Gauge Pressure in Flownex December 1, 2023
- Embedding a Designer in a Parametric Study November 22, 2023
- Setting Steady State Boundary Conditions October 19, 2023
- Adjusting Timesteps in Flownex September 29, 2023
- What’s New in Flownex SE 2023 September 15, 2023