sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    What use are Tool id's?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 2 Posters 257 Views 2 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.
    • S Offline
      slbaumgartner
      last edited by

      Is there any way to get a Ruby reference to a Tool identified by an id number returned from Tools.get_active_tool? For instance, model.select_tool wants a reference to a Tool, not an id. So, what can you do with a Tool id except display it for curiosity sake?

      Cursors are also identified by id numbers, but these numbers are what you pass to UI.set_cursor. Why not tools?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        Did you see my proposal in the SKX sub-forum ?

        [Code] (beta) Sketchup::Tools helper methods

        It would be nice if some similar functionality was rolled into the API.

        ❓

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          Also Sketchup::Model#select_tool() only takes a RubyTool instance.

          It does not accept native tool arguments in any form. That includes ids or tool names.
          One main issue we have had is that SketchUp's native tools are not exposed as a Ruby object.
          Another is that annoyingly the model's Sketchup::Tools collection is unaware of the specifics of a current Ruby tool, returning "RubyTool" as the name.

          Also although the API does not say so... a Ruby Tool eventually gets an integer command id assigned when it's menu item is created via Sketchup::Menu#add_item()

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @slbaumgartner said:

            So, what can you do with a Tool id except display it for curiosity sake?

            ON the PC they are actually the command IDs, so you can pass them as an argument to Sketchup::send_action()

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • S Offline
              slbaumgartner
              last edited by

              @dan rathbun said:

              @slbaumgartner said:

              So, what can you do with a Tool id except display it for curiosity sake?

              ON the PC they are actually the command IDs, so you can pass them as an argument to Sketchup::send_action()

              Thanks for all the info, Dan. Can I take it from this comment that this technique does not work on Mac?

              steve

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                Last I knew Mac only worked with string arguments for actions.

                I'm not here much anymore.

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

                Advertisement