Thanks a lot for the explanations.
I tried the following Python code to change the CoG :
https://pastebin.com/fZp7UECG
I tried to change the CoG of a BMW 2002 from front engine to rear engine.
In suspensions.ini I have :
=================
[BASIC]
WHEELBASE=
2.48
CG_LOCATION=
0.55
In car.ini I have :
===========
[BASIC]
GRAPHICS_OFFSET=0,-0.495,
-0.17
In the script I've set the wb, orig_cg and the z_offset accordingly.
I want to change the CG from 0.55% to 0.41% to make it rear engine.
If I try that script on an online Py interpreter, for example this one :
https://www.programiz.com/python-programming/online-compiler/
It calculates a new z offset of :
0.1772
Then if I put this in suspensions.ini :
[BASIC]
WHEELBASE=2.48
CG_LOCATION=
0.41
And the new z offset in car.ini :
[BASIC]
GRAPHICS_OFFSET=0,-0.495,
0.1772
At first glance it seems to work.