Setting motion statement frames

hey everyone

i created a motion statement with python but I cant figure out how to assign frames to the motion statement through python script help is greatly appreciated

as you can see this code makes a statement but with no frames
image

this is my code
image

I tried
pickPositionStatement.Base= Base1

but got an error that said Base1 not defined

please help thank you

Hy,

maybe try:

pickPosition.PositionInReference = part_pos_matrix

Regards
Feature

1 Like

thanks for trying to help but I was actually trying to set the value of the frame for the position statement.

pickPositionStatement.Base = I need a frame object here

What does VC-Help say?

you need a vcToolFrame…

vcToolFrame need a vcMatrix…

Regards
Feature

whats .Base Property does is you try to set a base to the statement. To define that you need to handle a vcBaseFrame. Its under vcRobotController on hierarcy.
To define a position you need to use .Positions Property. Its a list so you need to create a list of positions i guess.

1 Like

image

I use this code to set the base and tool of a statement

1 Like

You need to define position for the statement also.

myPositions =
myPositions.append(Add one position here…)
statement.Positions = myPositions

This is the answer!

Thanks

and @mschamp this code does the trick

thank you both.