• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
So far I see something in the code:

PathUnit pu = new PathUnit();
PathUnit.Position pos = new PathUnit.Position();

I have no more information and am just experimenting to see how to create a road by script.
 
More blundering around in the dark yields:

PathUnit.Position start = new PathUnit.Position();
PathUnit.Position end = new PathUnit.Position();

Vector3 vec = PathManager.CalculatePosition(start);

PathManager pm = GameObject.FindObjectOfType<PathManager>();
Randomizer rand = new Randomizer();

uint unit;
bool success = pm.CreatePath(out unit, ref rand, 0, start, end, NetInfo.LaneType.Vehicle, VehicleInfo.VehicleType.Car, 100f);
 
Take a look at NetManager, NetTool and other "Net" classes. I haven't looked into them much myself, but these classes seem to be responsible for roads (and probably train tracks and other paths).
 
Now I tried this:

NetInfo ni = GameObject.FindObjectOfType<NetInfo>();

NetTool.ControlPoint sp = new NetTool.ControlPoint();
sp.m_position = new Vector3(0, 60, 0);
NetTool.ControlPoint mp = new NetTool.ControlPoint();
mp.m_position = new Vector3(50, 60, 50);
NetTool.ControlPoint ep = new NetTool.ControlPoint();
ep.m_position = new Vector3(100, 60, 100);

FastList<NetTool.NodePosition> nBuff = new FastList<NetTool.NodePosition>();

ushort node;
ushort seg;
int cost;
int prodRate;
NetTool.CreateNode(ni, sp, mp, ep, nBuff, 1, false, false, true, false, false, 0, out node, out seg, out cost, out prodRate);

Still nothing yet.