RoboDK Forum
Export CSV or TSV data from RoboDK Target Data- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: Request new features (//www.sinclairbody.com/forum/Forum-Request-new-features)
+--- Thread: Export CSV or TSV data from RoboDK Target Data (/Thread-Export-CSV-or-TSV-data-from-RoboDK-Target-Data)



Export CSV or TSV data from RoboDK Target Data-alexrengel18-09-02-2021

Howdy,

这将是伟大的脚本或特性can export "Target" data (XYZWPR and E *external axis*) as a CSV or TSV file.

I have found that I use RoboDK to reverse engineer point data that does not include vector parameters like WPR or IJK, so it would be great to be able to create "Targets" from imported point data from Solidworks, then be able to export all of the "Target Data" back out with updated WPR or IJK parameters.

Contact me if further explanations are required!


RE: Export CSV or TSV data from RoboDK Target Data-Vineet-09-07-2021

If you wish to update the WPR of targets, here is a script which will help you:


Code:
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()


for i in range(1,4):
target_r = RDK.Item("Target %i" % i,ITEM_TYPE_TARGET)

target_pose = target_r.Pose()
xyzabc_1 = Pose_2_Fanuc(target_pose)
x,y,z,a,b,c = xyzabc_1
xyzabc_2 = [x,y,z,90,0,0] # Change the WPR here
target_pose = Fanuc_2_Pose(xyzabc_2)
RDK.Delete(target_r)
RDK.AddTarget("Target %i" %i )
target_add = RDK.Item("Target %i" % i,ITEM_TYPE_TARGET)
target_add.setPose(target_pose)



If you still wish to work with the a CSV, this example will give you a framework to get started://www.sinclairbody.com/doc/en/PythonAPI/examples.html#csv-file-to-program-xyzwpr


RE: Export CSV or TSV data from RoboDK Target Data-alexrengel18-09-07-2021

(09-07-2021, 06:32 AM)Vineet Wrote:If you wish to update the WPR of targets, here is a script which will help you:


Code:
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()


for i in range(1,4):
target_r = RDK.Item("Target %i" % i,ITEM_TYPE_TARGET)

target_pose = target_r.Pose()
xyzabc_1 = Pose_2_Fanuc(target_pose)
x,y,z,a,b,c = xyzabc_1
xyzabc_2 = [x,y,z,90,0,0] # Change the WPR here
target_pose = Fanuc_2_Pose(xyzabc_2)
RDK.Delete(target_r)
RDK.AddTarget("Target %i" %i )
target_add = RDK.Item("Target %i" % i,ITEM_TYPE_TARGET)
target_add.setPose(target_pose)



If you still wish to work with the a CSV, this example will give you a framework to get started://www.sinclairbody.com/doc/en/PythonAPI/examples.html#csv-file-to-program-xyzwpr

This is not what the issue is. I need to EXPORT target data into a CSV or TSV format OUT of robodk, not import data.

I should be able to highlight a group or targets, right click, Click "Export", Select File Type, and the script should export the XYZWPRE of the target into a CSV or TSV sheet.


RE: Export CSV or TSV data from RoboDK Target Data-Jonatanlaz-04-01-2022

Hello,
I would also need to know how to export some targets to csv or similar format.
I found out to use the "CSV" post-processor and then export the program. Is there any other way to export only the targets?
Thanks!


RE: Export CSV or TSV data from RoboDK Target Data-Jeremy-04-04-2022

There is no official way to export the position of targets to a CSV file, but creating such a python macro shouldn't be really hard.

Code:
for target in station:
add target.Pose() to CSV file


Jeremy