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 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()
) <---