private static Selection.Response select_a_body(ref NXOpen.Tag body)
{
//Part workPart = theSession.Parts.Work;
//Part displyPart = theSession.Parts.Display;
string message = "Hello";//信息
string title = "Select a body";//标题
int scope = UFConstants.UF_UI_SEL_SCOPE_WORK_PART;//取选择范围,返回一个固定的int类型的值
int response;
NXOpen.Tag obj;
NXOpen.Tag view;
double[] cursor = new double[3];
UFUi.SelInitFnT ip = init_proc;//通过创建一个委托来执行过滤器的方法
IntPtr userData = System.IntPtr.Zero;
theUfSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
try
{
theUfSession.Ui.SelectWithSingleDialog(message, title, scope, ip, userData, out response, out obj, cursor, out view);
}
finally
{
theUfSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);