//設定過濾條件
private int init_proc(IntPtr select, IntPtr user_data)
{
UFUi.Mask[] mask_faces = {
new UFUi.Mask {object_type = UFConstants.UF_solid_type, object_subtype = 0, solid_type = UFConstants.UF_UI_SEL_FEATURE_ANY_FACE}
};
try
{
theUfSession.Ui.SetSelMask(select, UFUi.SelMaskAction.SelMaskClearAndEnableSpecific, 1, mask_faces);
return UFConstants.UF_UI_SEL_SUCCESS;
}
catch
{
return UFConstants.UF_UI_SEL_FAILURE;
}
}
//選取多個面
public int SelectFaces(string title, out Tag[] objs)
{
int resp;
int count = 0;
objs = null;
//多選物件 (UF_UI)
theUfSession.Ui.SelectWithClassDialog (title, title, UFConstants.UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY,
init_proc, IntPtr.Zero, out resp, out count, out objs);
if (resp == UFConstants.UF_UI_BACK || resp == UFConstants.UF_UI_CANCEL)
return 0;
for (int ii = 0; ii < count; ii++)
theUfSession.Disp.SetHighlight (objs[ii], 0); //取消Highlight (UF_DISP)
return count;
}