Try (destroydialog gt_yc_ail) catch ()
Rolout gt_yc_ail "yongchao-alignment" width: 168 Height: 80
(
Spinner conunt_spn1 "" POS: [152,25] width: 12 Height: 16 range: [, 1] type: # integer
Edittext conunt_edt1 "" POS: [147] width: Height: 16 text: "negative direction of the Z axis" enabled: false
Button pick_btn1 "Start alignment" POS: [6, 49] width: 142 Height: 24
Groupbox grp1 "axial Selection:" POS: [5, 9] width: 160 Height: 39
On conunt_spn1 changed Arg do
(
New_obj = case Arg
(
1: conunt_edt1.text = "negative direction of the Z axis"
2: conunt_edt1.text = "positive direction of the Z axis"
3: conunt_edt1.text = "negative direction of X axis"
4: conunt_edt1.text = "positive direction of the X axis"
5: conunt_edt1.text = "negative direction of Y axis"
6: conunt_edt1.text = "positive direction of the Y axis"
-- Default: Reference $ foo
)
)
On pick_btn1 pressed do
(
Target_mesh = pickobject message: "Pick target surface:" filter: g_filter --- this method is better. No more display;
If isvalidnode target_mesh then --- this is useful if the node is not deleted.
(
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)