Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

ExportCSVScalar Class Reference

Last update: 16.07.2025

Exports scalar data to a CSV file. More...

Public Member Functions

virtual check ()
 Checks some settings/preperations. More...
 
 ExportCSVScalar (string output_file, DataObjectContainer filter, string delimiter=",")
 Initializing all member variables to valid defaults. More...
 
 save (Structure database)
 Exports all data to the given csv output file. More...
 

Public Attributes

string delimiter
 The delimiter string, e.g. ",", which delimits the data entries within one line.
 
bool optiSLang_compatibility
 If this is true, then the idents of scalar-quantities will be modified to match allowed characters in optiSLang (default: false)
 
string output_file
 The name of the output file. Must be non-empty. More...
 
bool replace_files
 If this is true, an existings output file will be overwritten. Otherwise an exception will arise (default: false)
 
DataObjectContainer scalars
 The scalar object data to be exported.
 
bool write_design_numbers
 Writes the design ID before each data set (default: true)
 

Detailed Description

Exports scalar data to a CSV file.

Exports only data assigned to the member variables scalars, node_data, element_data and intpt_data. If, and only if, ALL these memeber are empty, then the Settings class tries to write down all the database data automatically. If several data types shall be exported at once, than the output file given will be reused as some kind of template string extended by data type IDs. See the description at output_file for detailed information.

//!Exports SoS scalars to a CSV text file
When determining the number of designs and quantities to be exported, the method only considers those scalar objects which are part of

See also
ExportCSVSettings::scalars. Hence one can deactivate those quantities which should not be exported..
Parameters
settingsA setting class containing all the information to control data export to a CSV file
Exceptions
std::exceptionif more than one quantity is requested to export std::exception in case of conversion errors std::exception in case of program logical errors. Debug mode only

Constructor & Destructor Documentation

◆ ExportCSVScalar()

ExportCSVScalar ( string  output_file,
DataObjectContainer  filter,
string  delimiter = "," 
)

Initializing all member variables to valid defaults.

Parameters
output_fileThe name of the output file.
filter
delimiterThe delimiter string, e.g. ";", which delimits the data entries within the data sets. See csv::CSVParser::m_delimiter for more details.

Member Function Documentation

◆ check()

virtual check ( )
virtualinherited

Checks some settings/preperations.

Exceptions
std::exceptionIf the settings are not correct

◆ save()

save ( Structure  database)
virtual

Exports all data to the given csv output file.

If all member variables are empty all objects in the database will be exported. Otherwise the member variables acts as filter and only listed data will be extracted out of the database given and exported to the CSV file output_file given

Parameters
databaseThe database containing all objects.
Exceptions
std::exceptionIf the output path is not a directory std::exception If no the output_file is not writeable

Implements ExportCSV.

Member Data Documentation

◆ output_file

string output_file
inherited

The name of the output file. Must be non-empty.

Several modes in several situations are supported:

Connect with Ansys