RoboDK Forum
Create frame with Python- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛: General questions about RoboDK (//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+——线程:创建与Python框架(/Thread-Create-frame-with-Python)



Create frame with Python-Jonatanlaz-02-24-2022

Hello, how could I create a loop in Python that would automatically build a frame at a distance "X" from one already created?


RE: Create frame with Python-Jeremy-02-24-2022

Something like this would work:

Code:
from robodk import robolink # RoboDK API
from robodk import robomath # Robot toolbox
RDK = robolink.Robolink()

max_frame = 10
y_motion = 100
frame_base = RDK.Item("Name of the robot base frame", robolink.ITEM_TYPE_FRAME)


for i in range(0,max_frame):
new_frame = RDK.AddFrame("Frame"+str(i),frame_base)
new_frame.setPose(robomath.Offset(frame_base.Pose(),0,y_motion*i,0,0,0,0))

Jeremy