I have this code working well:
prompts = ["Trin", "Gevind"]
values = [@steps, @turns]
results = inputbox prompts, values, "Angiv antal;"
temp1, temp2 = results
if (temp1 != false)
@steps = temp1
@turns = temp2
steps = eval(@steps)
turns = eval(@turns)
mo.start_operation "screw"
screw(pt1, pt2, steps, turns)
mo.commit_operation
end
I want to leave out one of the fields, then I run this code:
prompts = ["Trin"]
values = [@turns]
results = inputbox prompts, values, "Angiv antal;"
temp2 = results
if (temp2 != false)
@turns = temp2
steps = eval(@steps)
turns = eval(@turns) #<<<<<<<<<<<<<<<<<< this is line 371
mo.start_operation "screw"
screw(pt1, pt2, steps, turns)
mo.commit_operation
end
and now I get this warning and error:
(eval):1: warning: Float 24.0 out of range
Error: #<TypeError: can't convert Array into String>
C:/Program Files/Google/Google SketchUp 8/Plugins/KSscrew.rb:371:in eval' C:/Program Files/Google/Google SketchUp 8/Plugins/KSscrew.rb:371:in
create_geometry'
C:/Program Files/Google/Google SketchUp 8/Plugins/KSscrew.rb:271:in `onLButtonDown'
WHAT THE HECK IS WRONG HERE ?
No problem in the first batch of code - an array with only 1 item should be allowed or .. ?