• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Pause/ Hold script for extra user input

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 738 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    MattC
    last edited by 29 Feb 2012, 15:27

    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

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 29 Feb 2012, 16:34

      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?

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • M Offline
        MattC
        last edited by 29 Feb 2012, 20:51

        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

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 1 Mar 2012, 00:11

          Read the linetool.rb example in the "Plugins/Examples" directory.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • M Offline
            MattC
            last edited by 1 Mar 2012, 09:26

            Ok, solved it in another way.
            Thanks anyway.
            Matt

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              1/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement