Grid command
Writes the table and matrix views a model defines out as CSV, so a table you read in the editor can also be read by whatever consumes CSV. The views themselves stay in the model, which is what keeps the export reproducible. Export grid views to CSV walks through an export step by step.
Export command
Export grid views defined in the SysML v2 model as CSV files. A hierarchical table
exports its whole tree with a leading Level column that records each row’s depth, as
described in Export to CSV.
Changed in version 1.0.0: The -i / --include and -e / --exclude options are removed. Set
include and exclude in syside.toml instead. Without paths,
the command loads the working directory.
Basic usage
Pass one or more model files or directories to export all defined grid views into the
output/ directory:
syside grid export [paths...]
<paths...>- one or more.sysml/.kermlfiles, directories (searched recursively) or glob patterns. Defaults to the working directory. The model loads the way syside check loads it, with the workspace’ssyside.tomland Sysand environment
Each view is written to its own file, named after the view’s qualified name with a
table- or matrix- prefix: P::'My Table View' is written to
table-P__My_Table_View.csv. Every character other than a letter, a digit, _ or
- becomes _, and letters outside English, such as Ü, are kept.
Two views can still reduce to one file name, for example A::B and a view named
A__B, or two names that differ only in case. One of them keeps the plain name,
and each other view gets -2, -3 and so on before .csv. The command prints a
note naming each view and the file it takes.
Note
This command exports grid views (table and matrix views) only. Other view
definitions are handled by syside viz view. Passing a
non-grid view to --qualified-name results in an error.
Available options
Option |
Description |
|---|---|
|
Display the help message with all available flags and short descriptions |
|
Path to a |
|
Qualified name of a view to export. Repeat
the option for each view, as in |
|
Save the CSV files to the given directory. Defaults to |
|
Export even when the model has errors, which can leave the CSV incomplete or wrong where they are. Critical errors, such as a syntax error, stop the export even with this flag. Warnings never stop an export, so they need no flag |
|
Prepend a Byte Order Mark (BOM) to the CSV file to ensure Microsoft Excel correctly detects the UTF-8 encoding and displays special characters properly. |
|
Longest file name to write, in characters, from 16 to 255. Only the view’s own
name is shortened to fit. The |
Note
In SysML v2, element names can contain spaces and special characters (e.g. 'Flight Controller v2' or 'Motor "Type A"'). When passing qualified names that contain
such names, make sure to quote or escape them appropriately for your shell. For
example, names with spaces should be wrapped in double quotes:
syside grid export -n "MyPackage::'My Table View'" models/
Alternatively, use simple names without spaces or special characters.
Exit codes
syside grid export exits with the following codes:
Code |
Meaning |
|---|---|
|
Success |
|
Failure due to errors in the model without |
|
Command-line usage error, such as an unknown option, a missing argument, no model files found, or no usable license |
|
Configuration error: a |
|
Nothing to export. The model has no table or matrix views, or at least one of
them has no rows or columns, so no file was written for it. This applies to a
view named with |
When several apply, the run exits with the most serious: 1 over 4 over 0.