try(destroyDialog gt_yc_Ail)catch()
rollout gt_yc_Ail "yongchao-对齐" 168 height:80
(
spinner conunt_spn1 "" pos:[152,25] 12 height:16 range:[1,6,1] type:#integer
edittext conunt_edt1 "" pos:[3,25] 147 height:16 text:"Z轴的负方向" enabled:false
button pick_btn1 "开始对齐" pos:[6,49] 142 height:24
groupBox grp1 "轴向选择:" pos:[5,9] 160 height:39
on conunt_spn1 changed arg do
(
new_obj = case arg of
(
1: conunt_edt1.text="Z轴的负方向"
2: conunt_edt1.text="Z轴的正方向"
3: conunt_edt1.text="X轴的负方向"
4: conunt_edt1.text="X轴的正方向"
5: conunt_edt1.text="Y轴的负方向"
6: conunt_edt1.text="Y轴的正方向"
--default: reference $foo
)
)
on pick_btn1 pressed do
(
target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter --- 这种拾取的方法更好。不用再显示;
if isValidNode target_mesh then ---这个好用, 是如果节点没有被删除。
(
undo "MoveToSurface" on
(
for i in selection do
(
int_point = find_intersection target_mesh i
if int_point != undefined then i.pos = int_point.pos
)--end i loop
)--end undo
)--end if
)--end pressed
)
createdialog gt_yc_Ail style:#(#style_border,#style_titlebar,#style_resizing,#style_sysmenu)