Pause/ Hold script for extra user input
-
Hello,
Is it possible to hold script until user performs specific action ?I have a situation like this:
- 2 groups that consist from one face each,
- script is activated, user clicks first group and then second group,
- script checks for intersection between those two, sometimes intersection is not found, then useg gets MB if he wants to pick two points that will define an intersection line(p1, p2).
Problem: After user clicks YES, script continues and then crashes because points p1 and p2 were not clicked.
I apprecciate any sugestions
Matt -
After the messagebox, activate a Tool that asks the user to pick to points.
When you say crash, does SketchUp bugsplat? Or did you mean an error was thrown in the Ruby Console?
-
I was not precise, After messagebox there is a call for function that uses two groups and two points as an arguments. And it returns error in ruby console.
Thanks for a tip. I was thinking about something like that.
But then another questions arise:
Lets say that my basic tool is Slot, and tool that will be used for picking points up will be Pointpicker. Lets say that point1 and point2 can be stored in an array : [p1,p2]
Q1 - what should be the callout? [p1,p2]=Sketchup.active_model.select_tool Pointpicker.new
Q2 - when the Pointpicker tool will be called from within Slot tool, will Slot tool be deactivated ? And after 2 points will be picked with the Pointpicker tool, how will it know that it should go to the Slot tool to specific line ?Thanks in advance.
Matt -
Read the linetool.rb example in the "Plugins/Examples" directory.
-
Ok, solved it in another way.
Thanks anyway.
Matt
Advertisement