I’m trying to automate some modeling but I can’t get the syntax for the functions to work in Sketchup. Here’s the code that I have right now
def wrud (width, running_vertical)
point1 = Geom::Point3d.new(running_vertical+width,$counter_overhangF,$kickplate_height) point2 = Geom::Point3d.new(running_vertical+width,$counter_overhangF,$countertop_height - $countertop_thickness) line = entities.add_line(point1, point2) running_vertical = running_vertical + width return running_vertical
wrud (10, running_vertical)
wrud (20, running_vertical)
I defined the variable running_vertical at the top and want it to increase every time I call the function (eg. if running_vertical = 0 at the beginning, I want it to equal 30 by the end).
The function essentially draws a line a “width” unit away from the original running_vertical.
Can someone let me know if my syntax is correct or if there is a mistake in my logic? Thank you so much!