Moving objects!

I still have not got this??! Can someone tell me a quick way to select this object (Disk with nut hole) and move it to the surface of the other? In Sketchup I’d just select on the top curve, hold shift to lock the Z-Axis, and it would snap when it touches the surface.

In the past I’ve achieved this by adding all manner of geometry, but the must be an easier way?!

FasterZAxisAdjust.3dm (2.0 MB)

Is this what you wanted to do? I used Move with two Center Osnaps.

Actually, it was to move the disk up the pipe till it touches the main model object underside face. I see that using center snaps could also work for that. Thanks.

However, I often encounter situations where moving and aligning objects is just a nightmare for me. I just assume there is something I’m missing. It is so easy in Sketchup, and that’s why I always revert to that for my paid work.

Have you spent time learning how Rhino works, perhaps by going through the Rhino tutorials available at Rhino - Learn to use Rhino, or are you assuming that Rhino should work like SketchUp?

With Grid Snap off and Intersection Object Snap selected go to the right viewport and zoom in to see the ring and the main body above it. Select the ring. Hold the mouse button down in the vicinity of one of the vertical isocurves and the top edge to get an Int selection cue. Slide the mouse/ring upward, holding down the shift key to constrain the direction, until you get an Apparent Int cue for the main object. Done.

You can also try the Clearance function. :slight_smile: It will create the closest line between two objects, plus two points at either way of the line, so it seems like that’s exactly what you need in order to alight them by moving one of them along the created line.
Adds the following alias “Clearance” and the custom button command for it must be “! _Clearance”.

findclearance.zip (971 Bytes)

1 Like

This helps! Another question. I have several Objects snaps always on. I’m sure at some point I came across a way to toggle between all on, or just a specific snap. Can’t find that now.

Very interested, but I don’t know how to load scripts. I’ve looked at discussions, but they are related to V5 and before, and involve editing code. Any instructions on how to insert this script and have it auto-load on startup? e.g. folder location/Path?

Hello - with this particular script you should:

  1. Download and unzip.
  2. Drag and drop the unzipped rvb file onto an open Rhino.
  3. Type ‘Clearance’

Any luck?

-Pascal

1 Like

Right click on the single Osnap you want to use to suspend the rest. Right click on it again to revert to the previous selection.

(If you need more info, check out the ‘Object Snaps’ section of the Rhino help file.)

Yep. Works great. Does this now mean that the script will be available in all later sessions of Rhino, or is it only the current project?

Yes.

-Pascal

Sweet. I have another script “MoveToCTR.rvb” that came about when I asked the same move question a while back. You might even be the person who pointed me to it. However I get this error when I try to use it.
error

MoveToCTR.rvb (360 Bytes)

Hello - that script should be called MoveToCtr.py; it is a python script.

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

I changed from .rvb to .py. I get this error on Tools>Python Script> Run
error_PY

Python uses indentation to delimit program structures. Every line below the Def line needs a tab added to the beginning (including the lines that already start with tabs).

you can lock the movement of an object at any direction using the Tab key once.
Select the object you want to move, define the origin point and dragging the mouse, define the direction.
Then press TAB once and it will lock that direction so you can search with the mouse any other osnap or reference as target.

1 Like

Try replacing the text inside the file with this ( _EditPythonScript to launch the script editor)
EDIT Thanks @jeremy5 for spotting multiple typos which I missed in the edit - I have now successfully tested it (previous reply on my phone)!

import rhinoscriptsyntax as rs

def MoveObjsBBCtrToW0():
	objs = rs.GetObjects("Select objects to center at world 0", preselect=True)
	if not objs: 
		return
	rs.EnableRedraw(False)
	origin = rs.coerce3dpoint([0, 0, 0])
	for obj in objs:
		bb = rs.BoundingBox(obj)
		if bb:
			ctr = (bb[0]+bb[6])/2
			rs.MoveObject(obj, origin - ctr)
	rs.EnableRedraw(True)

MoveObjsBBCtrToW0()

Python is case sensitive: If, For and In need to be if, for and in…

1 Like

If you are wanting to do it in a 3D view, you can use the command “move” and then click “vertical” in the command line prompt or type V and Enter. This will lock all movement to the Z-axis. Another router would be to do this operation in a side orthographic view. Just be sure you select “Project” in the lower portion of the UI.

It is also worth noting that there are a couple very useful “secret” menus in the Rhino interface. Before starting a command or at anytime after you can hover you mouse over the snap menu, located at the bottom of the UI, and hold either Ctrl (Rhino 5&6) or Shift (Rhino 6 only). The snap options will change. There are some super useful options that I use constantly. See attached images.

As a note, I am currently using SketchUp quite a bit. Coming from a Rhino background I see that while both have their place, Rhino is far superior in functionality and modeling ability. You need many plugins to achieve the functionality that comes standard in Rhino.

Hope all this helps.


Secrete Menu: