Using CheckPaths / Solver from Python API

Hello,

I am generating pick-and-place robot programs using the Python API, by programmatically creating robot motion statements.

At the moment, these motions do not consider collisions. To address this, I would like to use the Check Paths tool and the Path Solver, which I am able to execute successfully from the .NET API.

Below is an example of the .NET API code used to run collision checking and solve paths:

double success_rate = RoPath.RunPathCheck(StmtScope.Selected);
RoUtils.PrintMsg("success rate: " + success_rate);

RoPath.SolvePaths(RoUtils.GetActiveRobot(), PathKind.Via, StmtScope.Selected);

In this case, StmtScope.Selected refers to the statements currently selected in the Visual Components UI.

My questions are:

  1. Is there a Python equivalent of StmtScope.Selected, or a way to programmatically specify which motion statements should be checked and solved?

  2. If this functionality is not exposed in the Python API, what would be the recommended workflow to perform collision-free path solving for robot motions generated via Python?

Thank you in advance for your help.

Best regards,
Ronaldo Cachi