Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export CSV or TSV data from RoboDK Target Data
#1
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!
#2
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/exam...ram-xyzwpr
#3
(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/exam...ram-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.
#4
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!
#5
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
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.






Users browsing this thread:
1 Guest(s)