本帖最后由 leo3d 于 2012-10-26 14:14 编辑
rhino的空间内单轴移动捕捉很不好用,我写了个脚本,能在透视图实现单轴移动捕捉。
因为该工具偏向于rhino操作,所以帖子放在了rhino板块,如有不妥,版主见谅。
1:工具栏建三个按钮moveX,moveY,moveZ
2:分别使用以下脚本
!-runpythonscript
(
import rhinoscriptsyntax as rs
ids = rs.SelectedObjects()
if ids:
point1 = rs.GetPoint("Pick first point")
if point1:
point2 = rs.GetPoint("Pick second point")
if point2:
start=[point1[0],0,0]
end=[point2[0],0,0]
print start,end
vector = rs.VectorCreate(end, start)
rs.MoveObjects( ids, vector)
)
--------------------------------------------------------------------
!-runpythonscript
(
import rhinoscriptsyntax as rs
ids = rs.SelectedObjects()
if ids:
point1 = rs.GetPoint("Pick first point")
if point1:
point2 = rs.GetPoint("Pick second point")
if point2:
start=[0,point1[1],0]
end=[0,point2[1],0]
print start,end
vector = rs.VectorCreate(end, start)
rs.MoveObjects( ids, vector)
)
--------------------------------
!-runpythonscript
(
import rhinoscriptsyntax as rs
ids = rs.SelectedObjects()
if ids:
point1 = rs.GetPoint("Pick first point")
if point1:
point2 = rs.GetPoint("Pick second point")
if point2:
start=[0,0,point1[2]]
end=[0,0,point2[2]]
print start,end
vector = rs.VectorCreate(end, start)
rs.MoveObjects( ids, vector)
)
从此以后,单轴捕捉不用回到立面视图了,空间内可以操作.
建议设置为快捷别名mx,my,mz
将上面runpythonscript后括号内的代码(橙色部分)分别存到记事本文件,取名MoveX.py,moveY.py,moveZ.py
然后添加别名
mx
-RunPythonScript d:\\Documents\py\moveX.py
(此处对应你文件放的路径)
依此。。。。。
命令操作方式:选择物体,执行此命令,选择起点,选择终点---ok
注:仅支持物体单轴移动捕捉,不支持控制点的单轴移动捕捉
|