sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Developing a plugin/macro for orbiting based on input

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 146 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.
    • N Offline
      nirvanaguy
      last edited by

      So I have been reading up on tutorials how to code in Ruby and whatnot, but I am having trouble finding a solution to my problem and hopefully some of the experienced users here can help me out.

      I am trying to develop a plugin or macro that can take at least 1 input, lets say multiple keyboard letters for now, and map it to a function such as orbiting. I have thought about ways to do this and realized that you could just have the input (coming from a C# code) just send the physical key that is mapped to that function in the shortcuts, but I need something that's more robust and on a deeper level. That brought me to the point where I need to develop some sort of plugin that will respond something like this:

      ex: I press and hold D and the camera orbits to the right direction. I press and hold A and it orbits to the left direction. I hold A and W together and that orbits in the top left corner direction, etc.

      Not only do I want to be able to control orbiting, but I want to be able to draw lines based on a sequence of coordinate/position points I give to it. etc.

      Right now I know this sounds very ambiguous and dumbed down, but I would REALLY appreciate any help to set me in the right direction. Any input or suggestions are definitely welcome! if you have any questions about what i'm trying to do i'll answer as soon as I humanly can. Thanks a lot and I look forward to hearing some input!

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

        Using letters will be difficult, as they will trigger keyboard shortcuts. You can tap into the arrow keys - with a Tool class.

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

        1 Reply Last reply Reply Quote 0
        • N Offline
          nirvanaguy
          last edited by

          @thomthom said:

          Using letters will be difficult, as they will trigger keyboard shortcuts. You can tap into the arrow keys - with a Tool class.

          well then cant i just change my shortcut configurations and save the preferences.dat file?

          and i don't know if i can limit myself to just arrows because ultimately I'm going to be syncing this up with a C# code that will provide me both values for a position and for a function

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

            You'll have problems with re distributing the plugin - don't see any users willing to sacrifice their shortcuts.

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

            1 Reply Last reply Reply Quote 0
            • N Offline
              nirvanaguy
              last edited by

              @thomthom said:

              You'll have problems with re distributing the plugin - don't see any users willing to sacrifice their shortcuts.

              OK fine, just to have a baseline program that works how would I implement that using the keyboard arrows?

              Essentially the data i'm going to input is X,Y,Z position coordinates and an indicator of which operation I want to perform (orbit, move, draw, etc.) that will be constantly updating/refreshing so that I can draw a line in real time (I don't want it to just draw the line in 1 move for me, or orbit from 0 to 140 degrees west instantaneously, essentially I want to update in segments so it appears that this is all happening in real time)

              Thanks a lot for your help! I really appreciate any input you can provide

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

                Did you read the "linetool.rb" file in the "Examples" directory ??

                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