remilanza Posted February 10, 2013 Share Posted February 10, 2013 Hi, I'm making this script that is supposed to create a bunch of gears in random sizes, place them and wire them correctly. (First time I play with scripts) So creating the gears and placing them went fine. But I ran into a problem for the wiring. I have one array with the created Gears, and one array with the amount of teeths of each gear. In my script, the formula for the rotation of any gear, will include "R and "R[i+1]", where R is my array for number of teeths in each gear. The problem is that when I run the script, and check the wire parameters, I see that the formula still includes "R" and "R[i+1]" and not the real number it refers to. So then ofcourse the wiring wont work! Hope you understand, and thanks! Link to comment Share on other sites More sharing options...
vojtechcada Posted February 11, 2013 Share Posted February 11, 2013 If I get you right, when building the expression you want to insert the values of R and R[i+1] like this: expr = "Rotation * " + (R[i]/R[i+1]) as string paramWire.connect gears[i].controller[#Rotation] gears[i+1].controller[#Rotation] expr Or am I missing something? Link to comment Share on other sites More sharing options...
remilanza Posted February 11, 2013 Author Share Posted February 11, 2013 Thank you Vojtech. I guess I only needed to know about the "as string":) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now