[Plugin] "Drill" extension for making holes

[Plugin] "Drill" extension for making holes

Postby lunkwill » Tue Jun 02, 2009 6:10 pm

I'm making a cabinet in sketchup for export to a shopbot, and it's really a pain to make all the drill holes in the pieces. So here's my first ruby extension, drill.rb. Select it, type a diameter in the VCB, then click on a face. It creates a hole of that diameter (and leaves that "drill bit" installed until you change it) in the face then pushes it through if it can find an opposite, parallel face.
0

lunkwill 
 

Re: "Drill" extension for making holes

Postby thomthom » Tue Jun 02, 2009 6:26 pm

Sounds interesting.
(A screenshot would be very nice ;) )
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: "Drill" extension for making holes

Postby david_h » Tue Jun 02, 2009 6:33 pm

just gave it a try. It's pretty cool. I like it better than the Holes.rb
0
If I make it look easy. . .then it probably is.
User avatar
david_h 
Top SketchUcator
 

Re: "Drill" extension for making holes

Postby Chris Fullmer » Tue Jun 02, 2009 6:36 pm

Sounds great, and welcome to the forum! Hope you keep hanging around. There's always lots of good Ruby talk goin on here. And script requests too if you want a new project to start on :)

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: "Drill" extension for making holes

Postby Ken » Wed Jun 03, 2009 1:21 pm

Drill

Well drill comes close to a useable plugin. If the item is not a group or component, it works well, and has a function. However, it the item is a group or component, when you edit the group or component, and use drill, the group or component disappears.

Thanks for script.

Ken
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
Ken 
Premium Member
Premium Member
 

Re: [Plugin] "Drill" extension for making holes

Postby Didier Bur » Wed Jun 03, 2009 7:04 pm

Hi,

What's the difference with my "opener.rb" script ?
You can see it here: http://www.crai.archi.fr/RubyLibraryDepot/Ruby/em_arc_page.htm
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [Plugin] "Drill" extension for making holes

Postby lunkwill » Wed Jun 03, 2009 7:59 pm

Neat! The main difference seems to be that drill.rb only drills round holes, and it drills them with only one click.

Not being able to drill holes in components and groups (even if the component is in 'edit' mode) is pretty annoying, though. I had hoped that the API wouldn't make me worry about this distinction. Surely there's a standard way in ruby to draw on a face regardless of whether it's part of a component or group?
0

lunkwill 
 

Re: [Plugin] "Drill" extension for making holes

Postby TIG » Thu Jun 04, 2009 11:28 am

lunkwill wrote:Neat! The main difference seems to be that drill.rb only drills round holes, and it drills them with only one click.

Not being able to drill holes in components and groups (even if the component is in 'edit' mode) is pretty annoying, though. I had hoped that the API wouldn't make me worry about this distinction. Surely there's a standard way in ruby to draw on a face regardless of whether it's part of a component or group?


The version attached below has been tweaked to change this
Code: Select all
model.entities
to
Code: Select all
model.active_entities
which then lets you work in the model OR inside a group or definition edit...

Also - to find the circle-face made by the new circle arc you've just added I think the simplest method is to make it
Code: Select all
circle=view.model.active_entities.add_circle(center,normal,@@drill_diameter/2)
, and when you make a circle it returns an array of its edges ('circle='), now get the first edge circle[0], then get its faces and now faces[0] is the always inner one that you want thus...
Code: Select all
circleface=circle[0].faces[0]
(faces[1] is always the outer face - if it exists - that you will leave alone*)

*You are also getting some Ruby Console errors relating to your other_entities which make reference to deleted things - using my outline for finding the faces above should fix that... or use around code-lines in the early 70s
Code: Select all
if other.valid? and other.typename=="Face"
test to avoid error...

drill.rb
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] "Drill" extension for making holes

Postby meister » Thu Jun 04, 2009 7:47 pm

TIG wrote:
lunkwill wrote:Neat! The main difference seems to be that drill.rb only drills round holes, and it drills them with only one click.

Not being able to drill holes in components and groups (even if the component is in 'edit' mode) is pretty annoying, though. I had hoped that the API wouldn't make me worry about this distinction. Surely there's a standard way in ruby to draw on a face regardless of whether it's part of a component or group?


Its a possible adding depth of hole?

meister
0

meister 
 

Re: [Plugin] "Drill" extension for making holes

Postby zero » Sat Jun 06, 2009 12:13 pm

I don't know if i have something broken in my install,but i cant snap a hole on any line,construction line or point.is it normal.
0

zero 
 

Re: [Plugin] "Drill" extension for making holes

Postby bianhai » Mon Jun 08, 2009 3:25 am

Ver good! :thumb:
0

bianhai 
Banned
 

Re: [Plugin] "Drill" extension for making holes

Postby utiler » Thu Jun 18, 2009 2:16 am

This is great mate, well done!!
I think though; is it possible to somehow enable SU snapping [end point, midpoint, etc...] and also inference locking?

Many thanks!!!!
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] "Drill" extension for making holes

Postby cyan.archnet » Thu Jun 18, 2009 2:28 am

very interesting plugin, will give it a try, THANKS!
0

cyan.archnet 
 

Re: [Plugin] "Drill" extension for making holes

Postby k2wengen » Mon Mar 07, 2011 3:11 am

very simple and efficient tool!! good :fecstatic:
0

k2wengen 
 

Re: [Plugin] "Drill" extension for making holes

Postby m3a4 » Thu Mar 08, 2012 1:57 pm

sorry to bother the illuminatti with this, but something weird is happening to this plugin (edit: and others)

Only seems to drill a hole size "1". I'm using a metric setup so the hole shows as 22.x mm, I assume it's defaulting to imperial units..?

When ever I try to change the size, it still reverts and drills the hole size "1"

more;.. oops.. just tried another plugin that had an input and that's not allowing a change - or at least taking any notice of what I write in the box.

XP with v8

I've broken something! I've tried the repair from install, if that doesn't work, I'll rip it all out and reinstall? but curious if this has been seen before and what caused it.

Many thanks
0

m3a4 
 

Re: [Plugin] "Drill" extension for making holes

Postby m3a4 » Thu Mar 08, 2012 1:59 pm

oh, as I have to "drill" about 1500 holes, THANK YOU for the plugin! :-)
0

m3a4 
 

Re: [Plugin] "Drill" extension for making holes

Postby Dadio61 » Mon Nov 19, 2012 5:34 am

Thanks for the plug-in. It works at drilling a hole in my panel, but the diameter doesn't adjust, even though I'm entering a number in the vcd.
I looked at the sript in notepad and see the diameter number. So why isn't the diameter changing? Any suggestions?

Regards, Les
0

Dadio61 
 

Re: [Plugin] "Drill" extension for making holes

Postby Dave R » Mon Nov 19, 2012 11:13 am

Les, are you hitting Enter after typing the new dimension value? it works for me.

This plugin doesn't seem to utilize inferencing which makes it difficult to accurately place holes. I'd find this a really useful tool if it did.
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] "Drill" extension for making holes

Postby Dadio61 » Mon Nov 19, 2012 11:07 pm

Dave R,
Thanks for the suggestion on using the enter key. It works fine now.
I noticed that the unit of measure came up in the vcd also. In my case it is in millimeters.
tried several different hole sizes, from five millimeter to twenty millimeter, and all worked. This will work good enough for a model representation.
Thanks for your help.
0

Dadio61 
 

Re: [Plugin] "Drill" extension for making holes

Postby RiseUp » Sun Jan 13, 2013 10:24 pm

I've edited the plugin to include snapping/inferencing. That was the deal breaker for me—without snapping, this plugin was not useful to me. But with it, I will be using this all the time!

Thank you to lunkwill (the original author) and TIG (another tweaker) for all their work!

Hope you find this as useful as I did.
1

RiseUp 
 

Re: [Plugin] "Drill" extension for making holes

Postby Pants » Fri Oct 04, 2013 3:56 am

Does this really work for others?

I just installed the latest-gen plugin, and for me, it's got a drawback that makes it unusable: the diameter of the hole can't be changed. My various entries of different diameters do show up in the text-box, but I've been machine-gunning test-holes for a few minutes, and nothing about the diameter changes from one to the next, whether I've got "0.1" in the box or "11": all measure out at 0.875" (7/8"), which is the default hole-size.
0

Pants 
 

Re: [Plugin] "Drill" extension for making holes

Postby glro » Fri Oct 04, 2013 10:41 am

Pants wrote:Does this really work for others?

I just installed the latest-gen plugin, and for me, it's got a drawback that makes it unusable: the diameter of the hole can't be changed. My various entries of different diameters do show up in the text-box, but I've been machine-gunning test-holes for a few minutes, and nothing about the diameter changes from one to the next, whether I've got "0.1" in the box or "11": all measure out at 0.875" (7/8"), which is the default hole-size.


for me it is unstable

sometimes it works

most f the times it doesn't...
0

glro 
 

Re: [Plugin] "Drill" extension for making holes

Postby TIG » Fri Oct 04, 2013 10:59 am

You must press <enter> after typing the new size?

Also that size is currently always defaulting to decimal inches.
BUT if you edit the file at:
@@drill_diameter = 0.875
to read
@@drill_diameter = 0.875.inch***
then it'll work with any units you have setup or you input, taking unsuffixed values as 'current units' or those with suffixes alternatively: so if you are working in inches but want one hole at exactly 1cm type that +<enter>...
***If you normally work in say 'mm' change it to default to say '10mm' initially, if your model-units are mm then typing 12 + <enter> will make a 12mm hole...
I.E. @@drill_diameter = 10.mm
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] "Drill" extension for making holes

Postby glro » Fri Oct 04, 2013 11:20 am

TIG wrote:You must press <enter> after typing the new size?

Also that size is currently always defaulting to decimal inches.
BUT if you edit the file at:
@@drill_diameter = 0.875
to read
@@drill_diameter = 0.875.inch***
then it'll work with any units you have setup or you input, taking unsuffixed values as 'current units' or those with suffixes alternatively: so if you are working in inches but want one hole at exactly 1cm type that +<enter>...
***If you normally work in say 'mm' change it to default to say '10mm' initially, if your model-units are mm then typing 12 + <enter> will make a 12mm hole...
I.E. @@drill_diameter = 10.mm


yes, it works now

i usually use meter as default unit

I changed "@@drill_diametre = 1" into " @@drill_diametre = 1.m" in the plugin, and typed "enter" after changing the diameter

thank you
0

glro 
 

Re: [Plugin] "Drill" extension for making holes

Postby Dave R » Fri Oct 04, 2013 11:26 am

I'm curious about why hitting the Enter key seems to be a problem with this plugin when Enter is so frequently used with the native tools and there are many other plugins that have the same requirement. The fellow who posted immediately above the post with the most recent revision had the same problem which was solved by hitting Enter.
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] "Drill" extension for making holes

Postby glro » Fri Oct 04, 2013 5:18 pm

Dave R wrote:I'm curious about why hitting the Enter key seems to be a problem with this plugin when Enter is so frequently used with the default tools and there are many other plugins that have the same requirement. The fellow who posted immediately above the post with the most recent revision had the same problem which was solved by hitting Enter.


which default tools?

the VCB, Ruby console, ...?

most plugins input are made through a dialog box, and in this case, it is obvious: you click "OK" on the button

With the VCB, there is no button... you are just supposed to know it is necessary to hit "enter"
0

glro 
 

Re: [Plugin] "Drill" extension for making holes

Postby Dave R » Fri Oct 04, 2013 5:26 pm

With the VCB, there is no button... you are just supposed to know it is necessary to hit "enter"


Exactly. The native tools use the VCB and you have to hit Enter to make the setting. There are a lot of plugins which take their inputs via the VCB, Bezier.rb, BZ_Spline, Curvemaker, etc.
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] "Drill" extension for making holes

Postby Pants » Fri Oct 04, 2013 9:30 pm

glro wrote:
Dave R wrote:I'm curious about why hitting the Enter key seems to be a problem with this plugin when Enter is so frequently used with the default tools and there are many other plugins that have the same requirement. The fellow who posted immediately above the post with the most recent revision had the same problem which was solved by hitting Enter.


which default tools?

the VCB, Ruby console, ...?

most plugins input are made through a dialog box, and in this case, it is obvious: you click "OK" on the button

With the VCB, there is no button... you are just supposed to know it is necessary to hit "enter"


Yes, my mistake in not reading previous comments carefully - but as I think Glro indicates, in Sketchup, I have learned to resist what's usually the mistake of using an <enter> in the VCB, after getting used to all /other/ VCB uses (at least for me, thus far) virtually punishing me for what, in SU, is usually the MISTAKE of hitting <enter>. Yes, the <enter> requirement is typical of /other/ CAD software - and pretty much everywhere else in the world of data "entry," where nothing is "entered" until one hits "enter" - but I personally haven't used other plugins where this is the norm.

Reading sloppily through the above exchanges, I'd taken the mention of using <enter> as "you did't make the mistake of using "enter," did you?" and then somehow completely missed the response - and that was before I'd installed the plugin a few hours later, by which time I'd forgotten all of that anyway.
0

Pants 
 

Re: [Plugin] "Drill" extension for making holes

Postby Box » Fri Oct 04, 2013 9:43 pm

I'm not sure I understand how you can use SU and see hitting enter as a mistake. Enter is the norm.

Draw a circle, type 29s enter and it is a 29 sided circle, draw a line and type 357mm enter and it is a line 357mm long, ctrl move type 5x enter etc etc etc
0
User avatar
Box 
 

Re: [Plugin] "Drill" extension for making holes

Postby Dave R » Fri Oct 04, 2013 9:52 pm

David, like Box, I am confused as to how you think hitting the Enter key is a mistake. How in the world do you draw anything with precision if you aren't using Enter after typing values for the various operations you need to do? In fact there's no point in typing any values in the VCB is you don't hit the Enter key afterward.
0
%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: adrmike, medeek, NAGGA, pedrinalex, Pho Lam, Toto Jeff and 5 guests

Visit our sponsors: