Reputation: 1232
Is there a collection set or a reference manual of commands in Dymola? For example, if I wanna know the current working directory, which command should I use? I tried pwd
and dir
, but they didn't work.
Upvotes: 3
Views: 1149
Reputation: 7500
There are multiple sources to find commands which I check - in no special order - when it comes to finding a new command:
DymolaCommands
will automatically be loaded. This can be searched using the package browser's 'Search' entry (by right-clicking on DymolaCommands
-> Search).listfunctions()
to get an overview of the functions which can be called natively from Dymola's command line. Usually it makes most sense to search the text using CTRL+F afterwards.Modelica.Utilities
in which e.g. Modelica.Utilities.Streams.print
can be used to debug models by plotting strings to the simulation log. Another one that can be pretty useful is the library ModelManagement
.There are multiple possibilities to get the current directory.
cd()
: Unfortunately this will only print the directory to the command output and return true
. So this is more for manual checks, although the output can be retrieved by getLastError()
. Also this is Dmyola specific.Modelica.Utilities.System.getWorkDirectory()
and Modelica.Utilities.System.setWorkDirectory()
classDirectory()
will do that, using Dymola >2021.Upvotes: 7
Reputation: 12507
There should be a package called "Dymola Commands" or "DymolaCommands" in the package browser (at least since Dymola 2018).
You can open it as any other package, and either browser through the commands or right-click and use "Search" (tick "Full documentation").
Upvotes: 2