Adams 2023.4 Adams Car API Help
Introduction to Adams Car Python API

Description:


Welcome to the documentation for the Adams Car Python API
This documentation contains online help for the following modules.
database : Register and work with car databases
model : Provides assembly and subsystem object related function
event : Provides methods to event and event set related operations
utils : Contains general utility methods
fmu_export : Methods to export Adams Car FMU

Using the Adams Car Python API:


Import modules and the methods underneath (database, model, event_set, event, utils, fmu_export)

1 from msc.ADAMS.acar.utils import backup_file
2 backup_file("myfile.txt")
3 
4 
5 from msc.ADAMS.acar.model import Assembly
6 from msc.ADAMS.acar.model import get_immediate_children
7 mdi_demo_vehicle = Assembly.open("mdids://acar_shared/assemblies.tbl/mdi_front_vehicle.asy")
8 child = get_immediate_children('.MDI_Demo_Vehicle.ground','marker')
9 front_susp = mdi_demo_vehicle.subsystem_lookup('suspension', 'front')



The Assembly and Subsystem classes inherit from view Python so methods available for the Model
is also available for these classes. For example

1 print(my_assembly.full_name)
2 print(my_assembly.DesignVariables['assembly_file'].value)



Examples:


Examples for usage have been placed in the installation directory under
<installation_directory>/acar/examples/python_api
In it, there are examples which showcase the api:

example1.py - Event manipulation
example2.py - Assembly and Subsystem manipulation
example_doe_driver - An example DOE driver