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

    Passing instructions to active tools

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 353 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.
    • L Offline
      Lance_Uppercut
      last edited by

      **Hi,

      I'm planning out a plugin that would allow the basic Sketchup drawing tools to be used with absolute coordinates. The idea is to be able to START a line (or other shape), at a given point in 3D space, which would be entered via the VCB. The functionality would be close to the drawing tools in AutoCAD. (It's a request from a architect friend of mine who has some specific use in mind).

      Obviously Sketchup's tools don't respond to the VCB until you place the first point, and I know that it's not possible to extend the native Sketchup tools either. Is there some way of sending input points to an active tool via Ruby script instead? My idea was to set a ToolsObserver on the active model's tools object, collect some coordinates in the VCB, and as soon as a tool is activated, the observer callback function sends the previously entered input point to the tool as a starting point.

      So far I haven't seen any way of passing instructions to a tool, is this even possible?

      Thanks,
      Sebastian.**

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        You can not control the native tools via Ruby. But you can create your own Ruby tool which will accept VCB from the beginning - if you want.
        http://www.sketchup.com/intl/en/developer/docs/ourdoc/tool

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

        1 Reply Last reply Reply Quote 0
        • L Offline
          Lance_Uppercut
          last edited by

          I was afraid I'd have to do that...the base tools are not actually that simple, lots of state changes to keep track of. Anyway I'll start with LineTool.rb and go from there. Thanks Thom!

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Yea, even the Line tool has a lot of details. I've been replicating Rotate and Move in Vertex Tools. So much more than I originally though.
            Recently I started on a custom version of PushPull - it's giving me nightmares... πŸ˜•

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

            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