• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

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 24 Aug 2012, 03:53

    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
    • T Offline
      thomthom
      last edited by 24 Aug 2012, 07:22

      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 24 Aug 2012, 10:15

        @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
        • T Offline
          thomthom
          last edited by 24 Aug 2012, 10:38

          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 24 Aug 2012, 14:09

            @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
            • D Offline
              Dan Rathbun
              last edited by 24 Aug 2012, 14:55

              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
              1 / 1
              • First post
                1/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement