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

How to use point selection function/plugin in my script

#1
Hello,

I want to add point via "snap on arc" in my script/app.
   

Can I open the following window and add points using this?
#2
You can open the point follow project by provoking a double click event, then, trigger the Select action.

Example:
Code:
pfp = RDK.ItemUserPick("Select a point follow project", ITEM_TYPE_MACHINING)
pfp.setParam("Action", "DoubleClick")
pfp.setParam("Action", "Select")
#3
Thank you for the reply.

(1) Is there any way to retrieve the selected points using the following method in python code? I want to get those info (x, y, z) with normal vector.
(2) Is there any way to use "snap on arc" point selection helper(?) without machining program? I want to make my own plugin.

(05-03-2024, 02:25 PM)Albert Wrote: You can open the point follow project by provoking a double click event, then, trigger the Select action.

Example:
Code:
pfp = RDK.ItemUserPick("Select a point follow project", ITEM_TYPE_MACHINING)
pfp.setParam("Action", "DoubleClick")
pfp.setParam("Action", "Select")

One more question.

Could you tell me where I can find the documentation about this?
#4
You can find an example to retrieve the point and surface normal under the cursor here:
https://robodk.com/doc/en/PythonAPI/robo....GetPoints

This link also provides the documentation about the API.
#5
Thank you for the reply, Albert.

With your instruction, I have to get the point info one by one. Am I right? Is there a way to get the points stored in machining project at once?
#6
It is not possible to get the points of the robot machining project using the API. However, you can generate a program and use a CSV post processor to obtain the points.
#7
Hi Albert,

The documentation for item.GetPoints(feature_type=1, feature_id=0) says that the returned points are provided in [XYZijk] format in relative coordinates. 

My question is: what coordinate system are these points relative to? 

I would like to use the points as a way to identify items with different names that are located at the same point in 3D space.

Thank you.
#8
These points are provided with respect to the coordinate system that the object is attached to. You can find this pose by doing something like this:
Code:
abs_pose = item.Parent().PoseAbs()
abs_point = abs_pose * [x,y,z,1] # change the local XYZ point to absolute coordinates (station coordinate system)
# abs_vector = abs_pose * [i,j,k] # When providing a 3-float array it rotates the vector

Make sure you are using the latest version of RoboDK and the Python API.

If you are looking for other features in the viccinity of the retrieved points, you would have to iterate through all objects and compare the absolute coodinates.
  




Users browsing this thread:
1 Guest(s)