Hello everyone,
I encountered a strange bug when using setLink function from the Python RoboDk API.
I installed RoboDk v5.6.2.23532 (64b) - 2023-07-04 on two Windows PC. Both RoboDK have the exact same station opened.
I used the function setLink() from robolink on a target manually created. It works on my PC, but not on the other one.
Here's a sample code for reproduction:
On my PC this code do what it should.
On the second PC I have this error :
I checked the item type and name and it had the right values and then procedeed to check also the methods available on this object:
Output:
So everything that I was expected to have in a Target, but no sign of setLink function.
Does anyone know what could happen ?
Thank you
I encountered a strange bug when using setLink function from the Python RoboDk API.
I installed RoboDk v5.6.2.23532 (64b) - 2023-07-04 on two Windows PC. Both RoboDK have the exact same station opened.
I used the function setLink() from robolink on a target manually created. It works on my PC, but not on the other one.
Here's a sample code for reproduction:
Code:
from robodk.robolink import *
# Connect to the RoboDK API
RDK = Robolink()
if __name__ == "__main__":
robot = RDK.Item('ABB_IRB_4600-45/2.05')
p_drop_in_Aicon = RDK.Item("p_drop_in_Aicon",ITEM_TYPE_TARGET)
p_drop_in_Aicon.setLink(robot)
On my PC this code do what it should.
On the second PC I have this error :
Code:
Traceback (most recent call last):
File "C:\Users\ASUS\test.py"
AttributeError: 'Item' object has no attribute 'setLink'
I checked the item type and name and it had the right values and then procedeed to check also the methods available on this object:
Code:
p_drop_in_Aicon= RDK.Item("p_drop_in_Aicon",ITEM_TYPE_TARGET)
object_methods = [method_name for method_name in dir(type(p_drop_in_Aicon))
if callable(getattr(type(p_drop_in_Aicon), method_name))]
print(object_methods)
Output:
Code:
['AccuracyActive', 'AddCurve', 'AddFile', 'AddGeometry', 'AddPoints', 'AddShape', 'AddTool', 'AttachClosest', 'Busy', 'Childs', 'Collision', 'Color', 'Connect', 'ConnectSafe', 'ConnectedState', 'ConnectionParams', 'Copy', 'Delete', 'DetachAll', 'DetachClosest', 'Disconnect', 'FilterProgram', 'FilterTarget', 'Frame', 'GeometryPose', 'GetPoints', 'Htool', 'Instruction', 'InstructionCount', 'InstructionDelete', 'InstructionList', 'InstructionListJoints', 'InstructionSelect', 'IsInside', 'JointLimits', 'JointPoses', 'Joints', 'JointsConfig', 'JointsHome', 'MakeProgram', 'MoveC', 'MoveJ', 'MoveJ_Test', 'MoveJ_Test_Blend', 'MoveL', 'MoveL_Test', 'Name', 'ObjectLink', 'Parent', 'Paste', 'Pause', 'Pose', 'PoseAbs', 'PoseFrame', 'PoseTool', 'PoseWrt', 'ProgramStart', 'ProjectPoints', 'RDK', 'Recolor', 'RunCode', 'RunCodeCustom', 'RunInstruction', 'RunProgram', 'RunType', 'Save', 'Scale', 'SearchL', 'SelectedFeature', 'ShowInstructions', 'ShowSequence', 'ShowTargets', 'SimulatorJoints', 'SolveFK', 'SolveIK', 'SolveIK_All', 'Stop', 'Tool', 'Type', 'Update', 'Valid', 'Visible', 'WaitFinished', 'WaitMove', '__class__', '__delattr__', '__dir__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'addMoveC', 'addMoveJ', 'addMoveL', 'addMoveSearch', 'customInstruction', 'equals', 'getAI', 'getDI', 'getLink', 'getParam', 'isJointTarget', 'setAO', 'setAcceleration', 'setAccelerationJoints', 'setAccuracyActive', 'setAsCartesianTarget', 'setAsJointTarget', 'setColor', 'setColorCurve', 'setColorShape', 'setConnectionParams', 'setDO', 'setFrame', 'setGeometryPose', 'setHtool', 'setInstruction', 'setJointLimits', 'setJoints', 'setJointsHome', 'setMachiningParameters', 'setMillingParameters', 'setName', 'setParam', 'setParamRobotTool', 'setParent', 'setParentStatic', 'setPose', 'setPoseAbs', 'setPoseFrame', 'setPoseTool', 'setRobot', 'setRounding', 'setRunType', 'setSpeed', 'setSpeedJoints', 'setTool', 'setValue', 'setVisible', 'setZoneData', 'waitDI']
So everything that I was expected to have in a Target, but no sign of setLink function.
Does anyone know what could happen ?
Thank you