public void refreshenum() { Part workPart = theSession.Parts.Work; ModelingViewCollection a = workPart.ModelingViews; aaa = a.ToArray(); strvalue = new string[aaa.Length + 1]; int i; for (i = 0; i < aaa.Length; i++) { //enum0.GetProperties().SetEnum("Value", i); strvalue[i] = aaa[i].Name; } strvalue[i] = "添加新视图"; enum0.GetProperties().SetEnumMembers("Value", strvalue); }
public void dialogShown_cb() { try { ifcro.GetProperties().SetLogical("Value", false); cro.GetProperties().SetLogical("Enable", false); if (ifcro.GetProperties().GetLogical("Value")) { cro.GetProperties().SetLogical("Enable", true); } else if (!ifcro.GetProperties().GetLogical("Value")) { cro.GetProperties().SetLogical("Enable", false); } OpenFile("F:\\ano\\application\\CAPP助手.exe"); SetSBF(); Part workPart = theSession.Parts.Work; ModelingViewCollection a = workPart.ModelingViews; aaa = a.ToArray(); strvalue = new string[aaa.Length + 1]; int i; for (i = 0; i < aaa.Length; i++) { //enum0.GetProperties().SetEnum("Value", i); strvalue[i] = aaa[i].Name; } strvalue[i] = "添加新视图"; enum0.GetProperties().SetEnumMembers("Value", strvalue); //---- Enter your callback code here ----- } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } }