adams2017car How to generate adm file with cmd?

2023-02-26 17:07

To generate the ADM file of Adams Car using cmd batch processing, you need to use the command-line interface(CLI) tool provided by Adams Car. The CLI tool for Adams Car can be found in the Adams Car installation directory, usually in the following path:


To generate an ADM file using the CLI tool, you need to write a batch file that contains the CLI commands for Adams Car. Here is a simple example batch file:

@echo off
set ACAMGR=C:\MSC.Software\Adams\2017\Car\bin\win64\acacmgr.exe
set ADAMS_CMD=C:\MSC.Software\Adams\2017\Car\bin\win64\adams_cmd.exe

set WORK_DIR=C:\Path\to\your\working\directory
set MODEL_NAME=your_model_name

"%ACAMGR%" -cmd "acadmgen -s %WORK_DIR%\%MODEL_NAME%.acf -x %WORK_DIR%\%MODEL_NAME%.xml -o %WORK_DIR%\%MODEL_NAME%.adm"

REM 运行仿真
"%ADAMS_CMD%" %WORK_DIR%\%MODEL_NAME%.adm -job run -mpi -np 4

In this batch file, some environment variables are set first, and then the ADM file is generated using the acadmgen command. The -s option specifies the path to the input ACF file, the -x option specifies the path to the input XML file, and the -o option specifies the path to the output ADM file. After the ADM file is generated, you can run the emulation using the adams_cmd command.

Whether ACF and XML files can be pre-generated and stored depends on your requirements. If you need to use the same model and simulation parameters in multiple simulations, pre-generating these files and saving them may be a good choice. However, if you need to use different models and simulation parameters in each simulation, you will need to regenerate these files in each simulation.

dxw914 注册会员
2023-02-26 17:07

To use cmd batch processing to automatically generate the adm, acf, and xml files needed for ADAMS Car emulation, use the ADAMS Car command line interface(CLI) to do so. The ADAMS Car CLI can be invoked from the command line terminal in the ADAMS Car installation folder. Use the following command to invoke the CLI and generate an adm file:

"C:\Program Files\MSC Software\ADAMS\2021\bin\adams" -int -adm mymodel.adm -batch mybatch.txt

where "C:\Program Files\MSC Software\ADAMS\2021\bin\adams" is the executable file path of ADAMS Car, "mymodel.adm" is the name of your ADAMS Car model file, "mybatch.txt" is the name of the batch file that contains the command to be executed in ADAMS Car. The batch file is available using the ADAMS Car CLI command. For example, to generate an acf file, you can include the following command in the batch file:

file saveas mymodel.acf

Similarly, to generate an xml file, you can use the following command:

model apply_view DEFAULT_SIM_SETUP
model save_sim_setup mymodel.xml

You can also include other ADAMS Car CLI commands in the batch file for various operations.

With acf and xml file generation, you can do a simulation manually as you do now and save the results for subsequent calls. One drawback to this approach, however, is that if you change the model or simulation Settings, you have to regenerate these files to reflect the changes. Therefore, if you are changing your model or simulation Settings frequently, it is a good idea to generate these files automatically each time you perform the simulation through the ADAMS Car CLI.

yazippx 注册会员
2023-02-26 17:07

This answer partially references GPT, GPT_Pro to solve the problem better.
These three files are automatically generated, requiring cmd to write the batch file. Such a file is a simple command to perform steps to complete a task.

Perform the following steps to generate an adm file:

  1. First, enter "admgen-solution" in cmd. This step is used to generate the adm file;
  2. then, type "adams2017car.model". This step is to load the current model file;
  3. Next, enter "-solver". This step is used to specify the solver's parameters;
  4. Finally, type "-output". This step is to save the generated adm file to the specified folder.

Now that you have the adm file, you can use cmd to call the acf and xml files. The specific steps are as follows:

  1. First invoke acf file with cmd and type "adams2017car -l";
  2. Then you can invoke the xml file with cmd, typing "adams2017car -i".

So, to generate adm files, acf files, and xml files from cmd, just follow the steps above.

At present, the latter two files acf and xml are generated after manual simulation in advance, and then saved for other vehicle simulation to be called, this method is also feasible. However, there are several existing tools that can help you generate such files quickly, such as Adams Car Builder, Adams Car Modeler, and so on. Using them can realize auto simulation of vehicle faster and more conveniently.
If the answer is helpful, please accept it.

duguo863 注册会员
2023-02-26 17:07

Adams/View is used to generate Adm files, and Adams/Car is a complete simulation tool. Adams/View is included, so Adm files can be generated directly in Adams/Car.

To generate Adm files using cmd batch processing, use Adams/Car's command line interface. The specific steps are as follows:

1 Complete the establishment and setup of the vehicle model in Adams/Car.

2 In Adams/Car, select File -> Save As "to save the entire vehicle model file, for example, mycar.acf.

3 Open the cmd window and go to the bin folder in the Adams/Car installation path, for example,

cd C:\MSC.Software\Adams\2017\bin

4 Generate an Adm file using the Adams/Car command-line interface, for example,

AdamsCar.exe -int -adm mycar.adm mycar.acf

Where -int indicates that an interactive Adm file is generated, -adm is followed by the name of the generated Adm file, and mycar.acf is the name of the complete vehicle model file.

5 Adams/Car will start, generate the Adm file, and open it.

generates ACF and XML files in a similar way, which can be manually generated in Adams/Car and saved for other vehicle emulation to invoke. You can also use the command line interface of Adams/Car to automatically generate it. For details, see the help documentation and command line interface documentation of Adams/Car. In general, manual generation is more convenient because you have more control over parameters and Settings.

About the Author

Question Info

Publish Time
2023-02-26 17:07
Update Time
2023-02-26 17:07