Python scripting - Objects

CENPyOlpHomePosition

 

Methods

 

GetCount(): int

 

o

return

Returns the number of joints/position in this Home Position

 

Get the number of joints/positions in this Home Position

See Example_1 below.


 

GetJointAt(int index): CENPyOlpJoint

 

o

index

Index of the joint

 

o

return

Returns object CENPyOlpJoint representing the joint at the desired index

 

Get the joint at specified index

See Example_1 below.

 


 

GetName(): string

 

o

return

home position's name

 

Get name of the home position.

See Example_1 below.

 


 

GetPositionOf(CENPyOlpJoint joint): float

 

o

joint

The joint whose position to get as CENPyOlpJoint object

 

o

return

Returns the position of a given joint.

 

Gets the position of a given joint.

See Example_1 below.

 


[Example_1]

# Method to get joint value by joint name in home position

def get_joint_position_by_name(home_position, joint_name):

   for i in range(home_position.GetCount()):

      joint = home_position.GetJointAt(i)

      if joint.GetName() == joint_name:

         return home_position.GetPositionOf(joint)


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante