Hi @TheoSaify
What does the part you need to detect looks like? Could it be taught using the parametric teaching method? The parametric teaching method will avoid unnecessary rotation of the tool to pick a circle, rectangle or square.
If not, then when an object is detected, the object_location variable is updated and containing the detected part's position and orientation relative to the base reference frame. The orientation is always parallel to the work plane on which the calibration has been performed. Thus, the part's X and Y axes are always parallel to the work plane. The Z axis is always normal to the work plane and points downwards from it, into the work plane. You can then use the X,Y,Z position of the object_location and assign it to a position variable.
Please see section 6.2 of the manual for more details about the object_location variable.
I want the robot to make the same path every time it locate an object. i don't want it to change the path depending on the object orientation.