sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Linetool.rb snap

    scheduled pinned locked moved Developers' Forum
    4 Posts 3 Posters 582 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • 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.

      one-reply-to-this-post last-reply-time 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

        one-reply-to-this-post last-reply-time 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.

          one-reply-to-this-post last-reply-time 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

            one-reply-to-this-post last-reply-time 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