Search the Community
Showing results for tags 'functions'.
Found 2 results
Good afternoon everyone, can someone help me with a worksheet function? I am trying to pull out a record if a row and a column match a specific number or letter. Best i can describe is in the image below In this example - i am trying to pull out 24x36 in a work sheet if the record of column a and the row of 1 match in that cell. I am trying to do a metal panel schedule, and want to match the panel dimensions by row and column instead of putting all the information in rows. Has anyone ever attempted anything like this? the conditional statement of =if(symbol.record),statement is true, statement is false) doesn't seem to work for me, or I am (most likely)providing the wrong syntax to call out the information. Any suggestions please?
I like to deconstruct my larger more complicated scripts into smaller files. It helps me stay organized. I'm trying to get imported functions to use global variables that I have created but, it's not working the way I like and I'm not sure why. I have a main script that defines the global variables. The main script also imports demo.py and calls the function draw. The demo.py script is basically an if/else test. I've imported another file named shapes.py which has functions to draw shapes. -If the global variable 'w' is less than 6 call function myrectangle() from shapes.py -If the global variable 'w' is greater than 6 call function myoval() from shapes.py -if the global variable 'w' is equal to 6 print "Hello World" in a Alert Box. When i try to run i get: NameError: global name 'x' is not defined. I thought that if I had global variables defined in the main script i would be able to use them in the imported functions. Am I doing something wrong? main.py import vs import demo w=vs.PLineLength h=vs.PBoxWidth x = 0 y = 0 y = y-h/2 demo.draw() demo.py import vs import shapes def draw(): vs.PenSize(2); if w < 6: shapes.myrectangle() elif w > 6: shapes.myoval() elif w == 6: vs.AlrtDialog('Hello world.') shapes.py import vs def myrectangle(): vs.Rect(x,y, x+w,y+h) def myoval(): vs.Oval(x,y, x+w,y+h)