Generating Diagram with CLI

Hello! I’m trying to generate a diagram using the CLI:

syside viz element “MyPackage” ./ --depth "-1" --output-file model.pdf

When running, I’m getting this error:

error: unexpected argument ‘-1’ found

tip: to pass ‘-1’ as a value, use ‘-- -1’

I’ve tried following the tip, --depth -1, -d -1, -d “-1” - am I doing something wrong? For now my working around is -d 100.

Thanks!

Tom

Hi Tom,

In the specific case of -1, you should use --depth=-1 with an equals sign. However, -1 is already a default value for depth, so you can also safely omit it.

Similar question for the option fileType:

syside viz view myModel/ --fileType=pdf --output-dir diagrams/

gives me this error:

error: unexpected argument ‘–fileType’ found

tip: to pass ‘–fileType’ as a value, use ‘-- --fileType’

Tom

syside viz view does not have a --fileType (or equivalent) argument. For controlling the file type, define it in the view in SysMLv2 itself: attribute fileType = "PDF".

The reasoning behind it is that your SysMLv2 is the source of truth for what you want to visualise and how. Then, in your automated workflows you can just say syside viz view to generate all diagrams at once.

Thanks, that worked!

Is the documentation not correct then perhaps? SysML v2 Views (under: Configurable Attributes - fileType it says CLI only)

Ah, I see where the confusion might have come from!

In there, with “CLI only” we meant that the attribute only has an impact when using the Modeler CLI. In the Modeler VSCode Extension, when you visualise the view it will show you the interactive Tom Sawyer UI no matter what value you have fileType set to.