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

    Web console - Sketchup interface

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 1.3k 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.
    • T Offline
      TigerPilot
      last edited by

      There must be some kind of interface between the ruby scripting and SketchUP, beside the web console or the ruby console. Lets say you want to make a plugin that when the user is over a face it changes color and when he is gone form the face, it returns to the default color. Writing it in the web console alone will not let you try it since it goes through the code only once and you don't get a chance to go with the mouse over a face.

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        Hi Tiger Pilot, what you are wanting to write is considered a "Tool" plugin. You will need to make your own tool class, and there are specific methods it should include that will let SU access your code. For example, inside your tool class, you can make a onMouseMove method. Then while your plugins is active, SU will call your meth every time the user moves the mouse and SU will do whatever you say. In your example, you would probably make a "pickhelper" (this just helps you determine what is underneath your cursor). And eevrytime the cursor moves, you update your pickhelper and if it happens to tell you that you are hovering over a face, you would then write code that would change the color of that face, unil the face is no longer being hovered over.

        That is the general idea.

        You can search the forum here for some threads written by beginners for beginners about how to make a tool class, how to activate it in SU, etc.

        And, you can do this using the webconsole if you would like. It will work with tool plugins. I'll see if I can cobble togther a simple example for you.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • T Offline
          TigerPilot
          last edited by

          Thanks for the prompt reply, Chris. I will look forward to your code-snippets and will also search this forum for 'tool'. All I needed was a push in the right direction, and you gave it to me. In all the tutorials, yours included, no-one spoke of a tool, only of plugins, that's why I didn't know how to proceed.

          Yoram

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

            Check out the API manual on Tool class: http://code.google.com/apis/sketchup/docs/ourdoc/tool.html

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

            1 Reply Last reply Reply Quote 0
            • T Offline
              TigerPilot
              last edited by

              Chris, I found a snippet that you have posted in the past which will get me started. Thanks.

              Yoram

              1 Reply Last reply Reply Quote 0
              • Chris FullmerC Offline
                Chris Fullmer
                last edited by

                OK great. Come back with questions as often as needed.

                Chris

                Lately you've been tan, suspicious for the winter.
                All my Plugins I've written

                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