Jump to content

evaluating expression in python problem


wolf_cub_one

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...