I am trying to process Adams from either the command line or Matlab/python interfaces. I am looking for documentation that could help me with the following steps:
Opening Adams
Creating a project
Importing and running CMDs
Importing and running macros
Saving throughout
Simple simulations (lowest priority)
I have found resources giving some explanation but most require Adams to be open and a project to be created already. My CMD scripts and macros will import geometries and setup parameters so I mostly just need to know how to get these files in and run within the project.
The goal is to do this in batch with 20 or so projects that have specific CMD and macros for each.
Well, there is really not much to say about how to do this. It's very straight forward.
You can always start Adams/View from a command window using the mdi.bat script. Personally, I have scripts to start any version of Adams installed on my computer.
You can also start Adams/View in batch mode, i.e. no windows will pop up on your screen and all processing will be much faster. When you start Adams/View in batch, you will also specify a command file that will be processed by View.
So for me, to start Adams/View 2021.4 in batch, I have file aview214batch.bat with the following two lines:
"C:\Program Files\MSC.Software\Adams\2021_4_856550\common\mdi.bat" aview ru-s b %1
del aview.cmd
Now I can process a cmd file with the command
aview214batch my_commands.cmd
When I execute this, the file my_commands.cmd is copied to aview.cmd and Adams/View is started. Each time View is started, it will read the file aview.cmd if it exists. (that is why the aview.cmd is deleted after the A/View session is terminated) (so remmeber to end you command file with 'quit conf=no' or you will have a hanging process that occupies licenses).
The file my_commands.cmd can contain any valid Adams/View commands, read and execute macros, run and load analysis, save results and so on. Only your imagination can limit what you can do from here on.
The above bat file has one limitation; it locks the command prompt from which you started it from. Can be inconvenient if you want to run many parallel jobs. For that I use my bat file aview214batchclose.bat with the following content:
call "C:\Program Files\MSC.Software\Adams\2021_4_856550\common\mdi.bat" aview ru-s b %1
del aview.cmd
exit
The 'call' command will open a new command window where the A/View session will run. The 'exit' command will kill that window once the A/View session is terminated.
Well, there is really not much to say about how to do this. It's very straight forward.
You can always start Adams/View from a command window using the mdi.bat script. Personally, I have scripts to start any version of Adams installed on my computer.
You can also start Adams/View in batch mode, i.e. no windows will pop up on your screen and all processing will be much faster. When you start Adams/View in batch, you will also specify a command file that will be processed by View.
So for me, to start Adams/View 2021.4 in batch, I have file aview214batch.bat with the following two lines:
"C:\Program Files\MSC.Software\Adams\2021_4_856550\common\mdi.bat" aview ru-s b %1
del aview.cmd
Now I can process a cmd file with the command
aview214batch my_commands.cmd
When I execute this, the file my_commands.cmd is copied to aview.cmd and Adams/View is started. Each time View is started, it will read the file aview.cmd if it exists. (that is why the aview.cmd is deleted after the A/View session is terminated) (so remmeber to end you command file with 'quit conf=no' or you will have a hanging process that occupies licenses).
The file my_commands.cmd can contain any valid Adams/View commands, read and execute macros, run and load analysis, save results and so on. Only your imagination can limit what you can do from here on.
The above bat file has one limitation; it locks the command prompt from which you started it from. Can be inconvenient if you want to run many parallel jobs. For that I use my bat file aview214batchclose.bat with the following content:
call "C:\Program Files\MSC.Software\Adams\2021_4_856550\common\mdi.bat" aview ru-s b %1
del aview.cmd
exit
The 'call' command will open a new command window where the A/View session will run. The 'exit' command will kill that window once the A/View session is terminated.