Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Fast way to delete targets

I have a workstation with an enormous number of targets (>10k). As part of the normal workflow, they all need to be deleted. Typically, I would use:
[__.Delete() for __ in  RDK.ItemList(filter=robolink.ITEM_TYPE_TARGET)

However, this takes a long time. Is there a way to pass a list of targets to RoboDK for deletion, or must they be passed one-at-a-time? (This is the Python API, so I suspect that the individual calls to the socket are the source of the delay, not RoboDK itself taking a while to process each call.)

The obvious workaround is to put the targets under a parent and delete then recreate the parent to rapidly clear out everything underneath it. However, it's always nice to use the clean way to do it, if a clean way exists.
You should be able to delete a list of targets or any other items with one single delete command. You can find thet Delete command in your RoboDK object that can delete a list of items at once. This operation is very fast.

item_list = RDK.ItemList(filter=robolink.ITEM_TYPE_TARGET)
Thanks, Albert!

Users browsing this thread:
1 Guest(s)