Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A convert item function in the Python API
#1
Hello everyone,

I'm working on a project using the Python API, I would like to know if it's possible for you to create a function in the robolink module that converts an item to an object item as shown in the picture attached. It would help me a lot to continue my project! :)

Thanks

Best regards

   
#2
Hi Yohan,

We just added the option to convert geometries to objects using the RoboDK API. You should update RoboDK to the latest version (Windows 64 bit).

The following example shows how to do this conversion:
Code:
from robolink import *    # RoboDK API
RDK = Robolink()

# Get the item
itm = RDK.Item('Geometry Name')

# Convert to object and get the item pointer
obj = Item(RDK, itm.setParam("Convert", "Object"))

# Print the result
print(obj.Name())
print(obj.type)

Best regards,

Albert
#3
Hi Albert,

Thank you for taking my request into account. I have tested your code example, however I have an error appearing and I don't know where it came from. I have checked and I do have the latest RoboDK v5.2.3 version. Could you help me?
   

Best regards,

Yohan
#4
Hi Yohan, 

Did you update to 5.2.3 on May 25th or on May 26th?

Because we pushed two 5.2.3 updates this week including the latest with your requested improvements:

Quote:What's new:
New in RoboDK v5.2.3 (2021-05-26)

* Added option to convert geometries to objects or tools using the API
* Removed plugins that make RoboDK crash

New in RoboDK v5.2.3 (2021-05-25)

* Added script to attach objects to robot links (called: add object to robot)
* Added option to link multiple programs to a robot at the same time
* Allowing to place objects inside objects
* Improved Kinova driver
* Improved Kinova post processor
* Improved Epson driver
* Improved UR driver to support RobotiQ custom functions
* Added more toolbar options
* Reduced default toolbar icon size by 10%
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#5
Hi Jeremy,

I reinstalled RoboDK to be sure to be up to date, and now the conversion is working well!
Thanks for adding this function!

Best regards,

Yohan
  




Users browsing this thread:
4 Guest(s)