Hello,
Is there a way to move an object using world coordinates, but leaving some axis coordinates the same?
Example: Moving an object from (12.56, 5.22, 2.14) to (12.56, 5.22, 8).
I guess typing something similar to (-,-,8).
Being the first time that I have to write a question, I want to thank you guys for being such an awesome community, and spending so much of your time helping other people. You have saved me many times over the years.
Thank you Pascal,
but wouldn’t that move my object 8 units in the z direction? i want to move it to z=8 (r0,r0,w8).
perhaps a Setpt with rigid option?
Thank you very much Pascal.
I found that .z 8 (instead of .z 0,0,8) works the same.
One last question please, is there a command like copy’s InPlace, so i can avoid the last step (having to click again the From point) and put it in a macro?
Thanks again,
John
-They say laziness leads to inventiveness, so I prefer to think of myself as an inventor
Hi John - here is something you can try on a button to see if it does anything - bascially, when you’ve set your .z and get to the part where you want the From point just Ctrl-V to the command line.
! _-RunPythonScript (
import rhinoscriptsyntax as rs
import Rhino
import rhinoscriptsyntax as rs
import Rhino
def test():
wxy = Rhino.Geometry.Plane.WorldXY
ids = rs.GetObjects("Select objects to move", preselect=True)
if not ids: return
pt = rs.GetPoint("Point to move from")
if not pt: return
xForm = Rhino.Geometry.Transform.PlaneToPlane(wxy, rs.ViewCPlane())
ptCPlane = rs.PointTransform(pt, xForm)
rs.ClipboardText (ptCPlane.ToString())
print "From point copied to the clipboard, paste when you need it."
rs.SelectObjects(ids)
rs.Command("Move " + ptCPlane.ToString() +" " )
test()
To run the script in a button, you need one more close parentheses after the line Test()
That matches the open parentheses at the top after ! _-RunPythonScript (
...
rs.ClipboardText (ptCPlane.ToString())
print "From point copied to the clipboard, paste when you need it."
rs.SelectObjects(ids)
rs.Command("Move " + ptCPlane.ToString() +" " )
test()
) <---
Hi, I would like to do this kind of movement as well, but I don’t seem to get the hang of it. Can someone please elaborate how this works step by step? when I use the move command, select a point to start from, enter, and then type “.z” I can indeed specify a coordinate value, but afterwards it still asks me additionally where to move to… No matter what I type then, the object does not get moved to the z-coordinate provided…
Hi Kliefhead,
Using “.z” will lock the z coordinate on the value that you input, and then it lets you pick the x & y by clicking on a snap point. Personally I never use this way.
Here’s what I do instead
If you want to move an object to a certain z coordinate (for example z=5), without moving the object on x & y axis, you can try this:
A) Move > Vertical > 0,0,5
B) Move > Vertical > Click to snap on a point that is at the desired height.
C) In case you haven’t tried already, you could also check the box edit side panel, which is extremely useful and doesn’t get the love it deserves. You can input object coordinates there.
I show all three options on the video