sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    New to SketchUp; need some guidance on writing a plugin.

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    3 Posts 3 Posters 165 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.
    • M Offline
      mcglk
      last edited by

      I was asked to put together some instructions for a feral-cat shelter by the agency I volunteer for, and I thought SketchUp would be perfect. I have some background in drafting, and so I'm treating this as a set of 3D blueprints, as it were.

      The problem: I would like to write a tool that allows me to drill holes through a solid or a set of solids, or drill part-way through.

      The tentative plan: Create a Drill tool that uses the VCD to accept the bit diameter, and optionally the depth. More about this in a bit. (Edit: No pun intended. Honest.)

      This might be a little ambitious for a first plugin, but I've dusted off my Ruby knowledge and I'm gradually picking up the API. The pieces I don't have are: best practices for writing Ruby plugins (how to avoid namespace collisions, whether people prefer plugins grouped by author or not, and so on), how to make a tool cursor that can display the OnFace, OnEdge, Intersection and other such markers (particularly the latter, since I'm trying to make this an easy-to-use precision-capable tool), and how flexibly I can accept input.

      The trick: I'd like to be able to drill through a solid (or solids) obliquely, or through a solid (or solids) whose opposing faces are not parallel. Because of this, the push/pull tool will not do. My initial thought was to create a cylinder and intersect it with the shape, removing any geometry that would be "drilled out."

      For the sake of precision in future projects, I thought about adding a drill-point angle (defaulting to 118°) for drilling to a specific depth, but then I'm making cones and adding them to cylinders and doing the intersections and trying to figure out what to remove . . . and I'd rather solve the basic problem first (though I would love to solve this, too).

      Since I came up with this little learning project, I found that one isn't confined to using the VCD; entire UI panels can be designed. This means that I could (in theory) allow the user to create and keep a library of "drill bits", which could be very useful for these sorts of diagrams. But I don't know what the usual preference is here.

      Anybody willing to help me work through this thing?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • mitcorbM Offline
        mitcorb
        last edited by

        Hi, Welcome,
        Browse the Plugins and Developers Forum. Comments come up from time to time about best practices in those threads. You probably have already checked this out.

        I take the slow, deliberate approach in my aimless wandering.

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          hi,

          before reinventing the wheel, have you had a look at Tigs http://forums.sketchucation.com/viewtopic.php?t=30846

          or sdmitch's http://forums.sketchucation.com/viewtopic.php?t=40172, and I think there's others [in phlatboyz?]...

          If they don't do what you need they may be modifiable by you or the author or a collaboration [PM the authors]

          It's a good way to learn the 'ways' of SU ruby... although it still eludes me...

          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          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