the easiest would be to create a new one with sim.createPath. But keep in mind, the path object is more a convenience to offer the user a path that he/she can modify via the UI. If you generate a path via code, then you can simply use a simple data structure, that you can display with a drawing object.