Drilling holes

I want to locate some holes in an object. What I’m accustomed to doing in SU is two draw guide lines the desired distance from the edges on an object and use the resulting intersections to locate my holes. Can someone show me an efficient way to do this in Rhino. Here’s the very simple model. I’m needing to make 3/8 holes 2 inches in from the front and 2.75" from the back at a height of 2.75"

DisplaySystem.3dm.zip (14.3 KB)

One way to place either a reference point or the center of a RoundHole:

Start the command (Point, or RoundHole)
Type From.
Snap to the nearby corner as the From point
Type in relative coordinates R2,0,2.75

Less handy if things are not lined up to the current Cplane, in which case, set the CPlane to one of the faces - maybe the one to drill, with CPlane > Object.

-Pascal

Well, if the object is lined up to one of the orthogonal CPlanes, from that view, you can also use Offset with the surface edges (will create new curves) and you will have your intersections à la Sketchup.

If it is not lined up to the CPlane you can set a custom CPlane to the surface in question in the Perspective viewport - if you dare… :stuck_out_tongue_winking_eye:

–Mitch

I was sent a python script but I can’t seem to get it working. Can you see anything wrong with my setup here?

Can you post the script? If someone labeled it “xxx_cmd”, then maybe it’s not a normal python script…

–Mitch

ConstructionLine_cmd.py (645 Bytes)

This version should work-

import Rhino

def ConstructionLine():

    #Creates a construction line
    
    line = Rhino.Input.Custom.GetLine()
    line.EnableFromBothSidesOption(True)
    line.EnableFromMidPointOption(True)
    line.FixedLength = 10000000
    line = line.Get()
    line = line[-1]
    Rhino.RhinoDoc.ActiveDoc.Objects.AddLine(line)
    Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.Redraw()

ConstructionLine()

-Pascal

Beat me to it… --Mitch

I live for these moments.

-Pascal

LOL…

ps @pascal, could someone put up a “how to” for making/installing commands like the above in python on the developer wiki somewhere?

–M

OK, yeah, good idea. I am not at all sure it works on Rhino for Mac though, now that I think about it - I’ll ask Steve. Actually, I think I remember that it does, but maybe the rhi installer part does not work as in Windows.

Here’s a start: https://wiki.mcneel.com/developer/python/commands

-Pascal

Okay, so as I understand it, I need to take the code and paste into a python script program app such as X-code? Then place that version/ Output in the scripts folder? I’m really a noob in this area.

You can save it from a text editor as a py file and RunPythonScript. or run from Atom, which is fine too, because you’ll still have it in the end as a py file.

Open Atom, paste my code into a new file with all line breaks etc intact.
Save as AddConstructionLine.Py
In Rhino you can
RunPythonScript and then go get the py file and/or run StartAtomListener.
Back in Atom, right-click and choose RhinoPython > Save and Run in Rhino.

This assumes Atom is installed and configured and all that - I’ll see if I can find the thread that describes that process.

http://discourse.mcneel.com/t/rhino-for-mac-users-can-also-write-and-execute-python-scripts/18150

-Pascal

No, just do the same as you did in your post #4 above illustrated example. But use this script instead:

ConstructionLine.py (406 Bytes)

(it’s just what Pascal posted saved as a .py)

In the command box, put _-RunPythonScript “ConstructionLine”

Then it should work. You don’t need Atom in this case unless you actually want to create and edit your own scripts.

–Mitch

So the .py appended is not necessary for python scripts located in the scripts folder?

So I get this message when I try to run the command

I get the same error here on my Mac.

A simple way would be to Offset Curve on Surface.

Desired amount from desired edge

Then divid curve by number of segments or length, mark points

Then draw your circle from centre using a point or split end of your curve.

Then copy that circle from centre to all other points it is needed.

It would be nice if the script worked though.

«Randy

I was trying to figure out how to offset on a surface all the edges/curves at once but it seems I can only choose one curve or edge at a time. Working on simple flat surfaces seems to be rather tedious at this point. I tool that could operate on such with a momentarily implied construction plan would be very productive, eliminating a number of steps.

If you have a single surface, duplicateBorder then offset that.

If i have 2 different offset amounts I would just run DupBorder twice, select both offsets, explode them, select the 2 curves I want to use for drill holes, with them both selected i would then extend curve on surface to make these curves go to the edge of my surface. Then select all other curves and delete them. (Lock surface and invert selection)

Not sure i understand the second part of your sentence. The toll would be to setCplane, do your work, then undo Cplane.

IHTH «Randy

DupFaceBorder may also help.

-Pascal

1 Like