Welcome to Our Community

Some features disabled for guests. Register Today.

Ruby Language used to write a Sketchup Plugin?

Discussion in 'CNC Mills/Routers' started by Dawai, Oct 4, 2014.

  1. Dawai

    Dawai New
    Builder

    Joined:
    Oct 4, 2014
    Messages:
    19
    Likes Received:
    4
    Anyone familiar with Ruby? I have a Visual basic 6 program I'd like to port and add to the Phatscript gcode writer.

    My old program, It reads a dxf file, sorts through for "holes" circles.. sorts them in order, creates a file list, then writes a G81 command list to "drill" the holes sequentially, changing tools out in each hole sizes..

    I am new to Sketchup, old to autocad, scripting, cnc work.(a 57 year old kid) Own a Bridgeport cnc I converted from Paper punch tape to Mach3 & PC in 2001. Still running, thou my Pitt bulldog "Butch" pulled all the wires out the side in 2004?? and it has had to be wired back as I go. I just hope he got that mouse? or??

    Ordered the metal to cut my Ox plates on my bridgeport cnc.. noticed there is not a actual drilling menu icon. I am so tempted to cut a full sheet of them by laser and sell the remainder at cost.
     
  2. Dawai

    Dawai New
    Builder

    Joined:
    Oct 4, 2014
    Messages:
    19
    Likes Received:
    4
    PROBLEM IS: Sketchup does not have "circles" as objects, it has "multitude of arcs".. you'd have to convert the arcs all into circles..
    IN old autocad I drew circles on the provided "polyline pictures" then converted them to circles for a G81 drill list.
     
  3. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,272
    Likes Received:
    1,833
    Hi, I am the current SketchUcam maintainer.

    I don't see the need for this as part of SketchUcam (though admittedly for a lot of holes some sort of automation might be nice). you import the dxf to sketchup (make sure you preselect the correct units), then you just need to click on the center of each hole using the 'plunge' tool from Sketchucam.
    for very large holes it might be better to cut them out rather than drill,so I'd use an 'inside cut' for those (with an endmill).

    so long as there are no lines that intersect with the short horizontal colored line that the plunge tool draws the gcode will be fine.
    you can draw a line vertically from top to bottom of the circle so that the plunge tool can snap to the center point.

    Note that SketchUcam never generates G81 codes, just plain plunge motions, with retracts if you specify multipass. The reason for this is that it is used on so many platforms, some of which do not support canned cycles at all (like GRBL), that keeping up with all the variations is a lot harder than just programming the 'cycle' ourselves using G0 and G1 moves.

    Further, it assumes any plain plunge hole is at the current bit diameter, unless you specify a hole size larger than the bit diameter. In this case, it generates code to spiral bore the hole (so do not use a drill bit!).
    If multipass is OFF, it will only spiral bore for holes less than 2xBitdiameter, and center plunge then spiral for larger holes.
    if multipass is on, it will first peck the center then spiral bore the rest at 50% stepover. I want to extend this to make it use the current stepover setting as an option for hard materials since using 50% stepover is bad for tool life in metals (according to Sandvik Coromant, use 30% or less, or 70% or more, stepover from 30 to 70% decreases tool life).

    currently no tool changes are supported, though it is on my list of 'things to add one day'.

    However, you can use groups and a little manual editing to do it.
    Any items that are grouped are cut together, and if you give the group a name in 'entitiy info' you will see the group name in the Gcode as a comment.
    Thus you can group all the holes for tool1, group for tool2 etc, and then manually insert the tool changes in the Gcode just after each group name comment.
     
    Mark Carew likes this.
  4. Dawai

    Dawai New
    Builder

    Joined:
    Oct 4, 2014
    Messages:
    19
    Likes Received:
    4
    Hi.
    IN frustration I purchased CamBam, so far I am loving it. Old school type drawing interface, I did a jpg import into stl in Sketchup, sketched the main design on another layer, deleted the jpg, extruded the layer upward, then imported it into Cambam and produced Gcode off it. Most of my work here is holes, building machinery and "toys" for myself. Some minor milling operations but the old bridgeport has a bent spindle and sometimes likes to eat endmills. they are all bent, get worse with time and use, hard use here.

    No reason to write Ruby code, learn a new language that will be dead next week perhaps?? I started out with GW Basic to give you a reference to how long I have been at this.
     
    David the swarfer likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice