06-11-2025, 04:19 PM
I have a script that is trying to read XYZIJK values from a CSV file and create a curve. I think that I am arranging the list of points correctly, but the error message says that I am not.
Could somebody please let me know what I am doing wrong?
Here is the script output (I cut out a lot of lines to save space)
Here is the class method that is trying to make the curve:
Could somebody please let me know what I am doing wrong?
Here is the script output (I cut out a lot of lines to save space)
Code:
Saved 374 points to a list for making a curve
[
[57.876006, -130.844612, 45.042276, -0.444945, -0.691147, 0.569508],
[80.123256, -96.287262, 16.566876, -0.444945, -0.691147, 0.569508],
[84.920716, -90.68758, 11.481738, -0.444945, -0.691147, 0.569508],
[91.151761, -86.472903, 6.619512, -0.444945, -0.691147, 0.569508],
[98.503944, -83.854571, 2.224012, -0.444945, -0.691147, 0.569508],
{snip}
[183.922805, -220.500173, -62.102005, -0.528125, -0.79715, -0.292636]
]
WARNING: Invalid curve, a 3xN (or 6xN) list of points must be provided
The result of adding the new curve was RoboDK item (INVALID)
Here is the class method that is trying to make the curve:
Code:
curvePoints = list()
for n in range( len(self.csvPoints) ):
P = self.csvPoints[n]
curvePoints.append([P.x, P.y, P.z, P.i, P.j, P.k])
self.log(f'Saved {len(curvePoints)} points to a list for making a curve')
print(curvePoints)
# Get a reference to the desired work object
targetObject = RDK.Item(WorkObject, 3)
if targetObject == None:
self.log(f'Could not find a FRAME called "{WorkObject}" in the station')
return False
# Make the curve
result = RDK.AddCurve(curvePoints, targetObject, True, 0)
self.log(f'The result of adding the new curve was {result}')