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

    Linetool.rb snap

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 558 Views 3 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.
    • C Offline
      Casey
      last edited by

      I have been messing with the linetool.rb example and copy parts into my tool class, which is the code in the linetool.rb that makes the coloured dots appear over vertices before you click? I assume its in the mousemove function but I tried replicating it to no avail.
      Sorry if its a dumb question but its hard to find much info about and the google docs can seem a bit vague.

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

        That's the InputPoints that draws them. Look in the draw method.

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

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

          @casey said:

          ... which is the code in the linetool.rb that makes the coloured dots appear over vertices before you click?

          That function is built into the UI::InputPoint class, and is called "inferencing".
          You can clear or lock the inferencing using the view.lock_inference method.
          You cannot totally disable inferencing, if your tool is using UI::InputPoint.

          @casey said:

          I assume its in the mousemove function but I tried replicating it to no avail.

          If you wish to use your own special inferencing (or snap feature,) you must write it yourself, by using UI::PickHelper object, instead of a UI::InputPoint class object. You will be responsible for drawing the point at the proper place on the view, using one of the view draw methods: view.draw, view.draw2d, view.draw_points, etc.

          @casey said:

          Sorry if its a dumb question but its hard to find much info about and the google docs can seem a bit vague.

          Yes the docs are vague. For more help see:

          [Tutorial] PickHelper - Visual Guide

          I'm not here much anymore.

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

            aiai... I meant to do a new version of that guide. ...one that made sense... 😳

            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