Python API and automation

I want to make the python script for the scenario editing so I can edit the scenario no need to create new every time. some one did automation the sceanrio? or someone knows the API for the python please provide me.

1 Like

Hi Rahul,

You can access the Python API information through the main GUI.
Main GUI → Help → Additional Documents → CarMaker Python API Reference

I am not sure what you want to edit but if you are looking just for making small changes, I think it would be a good idea to look at the section Test Automation in the the User’s Guide.
Main GUI → Help → UsersGuide

HI Joes

As long as I know that carmaker dont have a python API. it is only possible with C language and not traffic automation only we can access road parameters.

You are right there is a section for automation but it for test automation not for scenario.

Hi Rahul,

Which CarMaker version are you using? If you are using CarMaker 10.2 or 11 you should find the information.

You can modify your scenario with TestManager for example using NValues for setting traffic objects initial position. So it depends of what you want to change.

If you are looking for programmatically create roads , you can find information in the IPGRoad API Reference. You can access to that through Main GUI → Help → Additional Documents → IPGRoad API Reference

1 Like

Hi Jose

I am using 10.0.1 version.

If I dont want to use the test manager for modify the traffic paramters. My goal is to first create the generic scenario and create the python script. Using that script I can access the parameter like velocity for ego and target vehicle, so every time dont need to opne carmaker. just change the value of the parameter in python script and run, scenario is ready.

In this python API can we also access traffic parameter and all other parameters with road or same like previous verson we can only create road with the API? is it a sepaerate API?

HI jose

I installed the updetd version of the IPG. I also check the Python APi but as per my point of view it still only do the test run automation not scenario. I did not get any information regarding the Manauever and traffic parameter API.

Hi Rahul,

The ‘scenario’ is the TestRun. The TestRun contains the manoeuver and traffic parameters.

If you open the Python API documentation and click on Getting Started then you will find a section dedicated to ‘Parameterizing variations’. In this section there are a number of examples of varying scenario parameter key values. You would just need to open your own TestRun to find the exact key you would like to vary and then adapt the example accordingly.

The Python API documentation can be opened from the main CarMaker GUI under Help > Additional Documents > CarMaker Python API Reference.

If you have any problems then feel free to post the code you have developed so far and the exact key/s you are trying to vary and we can probably help further.


HI rahul … iam working on carmaker automation using python CMapi…
could you please tell me how can i get the results of a simulation… whether the simualtion is completed or not…
kindly share the code if you have it.

1 Like

Hi David
I’ve used
Testrun= project.insyance().loadtestrunparameterization(pathoftestrun)

Here get_parameter_value is working fine
But set_parametr_value isnot…
Help me with this