wolf_cub_one Posted August 11, 2009 Share Posted August 11, 2009 Hey everyone, I have a simple problem which deals with how python evaluates expressions. If I write for example: object.parm('dirx').set(90) My object's x direction parameter is set to 90. However, what I want is to use an expression instead like for example: object.parm('dirx').set(sin($F * 10)) What is the proper syntax to get this to work? Thanks for any help Quote Link to comment Share on other sites More sharing options...
graham Posted August 11, 2009 Share Posted August 11, 2009 All you need to do to use an expression is simply call setExpression: object.parm('dirx').setExpression("sin($F * 10)") Quote Link to comment Share on other sites More sharing options...
wolf_cub_one Posted August 11, 2009 Author Share Posted August 11, 2009 Hey Graham, Thanks. I tried setExpression before I posted but it didn't work. Then I look more closely at what you wrote and realized that I forgot to encase the whole expression in double quotes. Also since, I already had double quotes in the actual expression that I'm writing that I needed to enclosed the whole expression in single quotes. It's always the simple stuff that gets you. Thanks again for the help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.