• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

How to implement entity selection "wizard"

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 4 Posters 1.0k Views 4 Watching
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.
  • I Offline
    ittayd
    last edited by 19 Apr 2017, 18:37

    In Sketchup most of the tools contain a sort of "wizard" where the status line tells you what to pick and then when you pick it, what to pick next, etc. How can I do this in an extension?

    1 Reply Last reply Reply Quote 0
    • S Offline
      sdmitch
      last edited by 19 Apr 2017, 19:50

      @ittayd said:

      In Sketchup most of the tools contain a sort of "wizard" where the status line tells you what to pick and then when you pick it, what to pick next, etc. How can I do this in an extension?

      The set_status_text method is used to set the text appearing on the status bar within the drawing window.

      If no arguments are passed, the status bar content is cleared. Valid positions are:

      SB_PROMPT - the text will appear at the left-side of the status bar
      SB_VCB_LABEL - the text will appear in place of the VCB label
      SB_VCB_VALUE - the text will appear in the VCB

      Sketchup.set_status_text "This is a Test", SB_VCB_VALUE
      

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

      1 Reply Last reply Reply Quote 0
      • I Offline
        ittayd
        last edited by 20 Apr 2017, 07:50

        Thanks. And how do I pick elements one by one? Do I need to listen to mouse clicks or is there something that takes care of the flow for me?

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 20 Apr 2017, 11:17

          You need to set up your Extensions as a 'Tool'.
          http://ruby.sketchup.com/Sketchup/Tool.html
          Clear the selection as you initialize.
          On a mouse-click you use a pick-helper.
          That filters what you have clicked on - so you can have various results.
          You then filter that further by limiting what chosen by some other factor[s] like: context, already-selected, material, layer, name, attribute etc.
          If you have a valid object add it to the selection.
          Repeat until the user exits - e.g. double-click or <enter> press - then go onto the next step in your tool...

          TIG

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dan Rathbun
            last edited by 21 Apr 2017, 02:15

            ... and new for SketchUp vers 2016 and higher is a rectangular window picking method:
            http://ruby.sketchup.com/Sketchup/PickHelper.html#window_pick-instance_method

            You should download the SketchUp Team's Examples extension to see how Tools are written.
            http://extensions.sketchup.com/en/content/example-ruby-scripts

            I'm not here much anymore.

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

            Advertisement