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

    New developer wants to simple plugin

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    4 Posts 4 Posters 193 Views 4 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.
    • S Offline
      stevo_wis
      last edited by

      Hi,
      I am a fairly experienced Sketchup user, a professional data processor (but new to object oriented), and a serious chairmaker. I use sketchup to rotate things like legs, spindles etc. and a plugin would help me greatly. Where I am getting hung up to start is with the interfaces and other issues.
      I see it working this way. The user must select a component to tilt, then call the plugin.
      The plugin would display a dialog and/or input boxes where the user would type in a few x, y values and select other options. The plugin would check to make sure a component is selected, do some math on the x, y values, and then rotate the component. I have Scarpinos book "automatic sketchup" which is a good start, but the dialogs are a bit basic.
      When I store my test plugin in the plugins directory (windows), it runs every time I start sketchup, unlike the other plugins that are stored there.
      Does anyone have any advice to; 1. follow simple rules for good plugins, 2. locate some good sample dialogs, or just general ingo.
      Thanks,

      Stevo

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        You need to wrap your code in a method [def] OR better inside a 'class' or even betterer a 'module'. That way you can then run your code from the Ruby Console to test it, or add some extra menu code to the end of your script to execute the tool from a menu item... Find any of my Plugins [there's an Index button...] and read them to see how the code is 'wrapped' and menus made etc... even the simpler ones don't run when Sketchup starts [unless there's something like an observer that needs to run at kick off...] 🤓

        TIG

        1 Reply Last reply Reply Quote 0
        • Dave RD Offline
          Dave R
          last edited by

          Hi Steve! I can't wait to see what you come up with.

          This guy is really good. His SketchUp learning project was a Welsh stick chair. There's nothing like just diving in head first.

          Etaoin Shrdlu

          %

          (THERE'S NO PLACE LIKE)

          G28 X0.0 Y0.0 Z0.0

          M30

          %

          1 Reply Last reply Reply Quote 0
          • K Offline
            kyyu
            last edited by

            Stevo,

            You should make a simple plugin, 1st. For example, try having an message box pop up with the text "Hello". That's like 1 line of core code, but the rest will be a wrapper that creates the actual plugin. Check out these videos: http://www.youtube.com/user/ChrisFullmer#g/u Then you can try writing your plugin. Brake it up into pieces and get each piece working, before moving on to the next. For example, 1st piece might be to simply to rotate the selected group/comp 90 deg. For user input, you can probably just use an input box: http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#inputbox

            You see that I went to the Sketchup Ruby API documentation, when I wanted to research how to do something: http://code.google.com/apis/sketchup/docs/index.html

            -Kwok

            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