Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

PYTHON API GETPOINTS NOT WORKING

#1
From the documentation:
Code:
GetPoints(feature_type=1, feature_id=0)
Retrieves the point under the mouse cursor, a curve or the 3D points of an object. The points are provided in [XYZijk] format in relative coordinates. The XYZ are the local point coordinate and ijk is the normal of the surface.

Parameters
feature_type (int)——将FEATURE_SURFACE to retrieve the point under the mouse cursor, FEATURE_CURVE to retrieve the list of points for that wire, or FEATURE_POINT to retrieve the list of points.

feature_id (int) – used only if FEATURE_CURVE is specified, it allows retrieving the appropriate curve id of an object

Returns
List of points

From the actual `.py` file:
Code:
def GetPoints(self, feature_type=FEATURE_HOVER_OBJECT_MESH)
...
if feature_type < FEATURE_HOVER_OBJECT_MESH:
raise Exception("Invalid feature type, use FEATURE_HOVER_OBJECT_MESH, FEATURE_HOVER_OBJECT or equivalent")

The API documentation allows the use of `FEATURE_CURVE` and `FEATURE_POINTS`, but the actual code prevents this. Additionally, the actual code takes only one argument, disallowing the `feature_id` parameter that the API documentation specifies.

Am I doing something wrong, or is this a bug?

Python 3.11.1
RoboDK 5.4.3
Windows 10 Pro
#2
One definition of GetPoints is global and returns the the selected object (Robolink) and the other definition of GetPoints applies to one specific object (Item).

I recommend you to take a look at the example you can find in the Item GetPoints:
//www.sinclairbody.com/doc/en/PythonAPI/robo....GetPoints
#3
Thanks, Albert! That solved my problem.




Users browsing this thread:
1 Guest(s)