Example #1
0
 public MachinedSurface()
 {
     try
     {
         InitializeComponent();
         theSession = Session.GetSession();
         NXOpenUI.FormUtilities.ReparentForm(this);
         NXOpenUI.FormUtilities.SetApplicationIcon(this);
         undomark = theSession.SetUndoMark(Session.MarkVisibility.Visible, "加工面标注");
         //记录并改变View的类型
         Part workpart = theSession.Parts.Work;
         foreach (NXOpen.Drawings.DraftingView draftingview in workpart.DraftingViews)
         {
             NXOpen.Preferences.GeneralExtractedEdgesOption type = NXFun.GetViewEdgesPreference(draftingview);
             map.Add(draftingview, type);
             NXFun.SetViewEdgesPreference(draftingview, NXOpen.Preferences.GeneralExtractedEdgesOption.Associative);
         }
         label1.Text = "- 请选择加工面 (0)";
         //开始监控选定的东东
         this.timer1.Start();
     }
     catch (System.Exception ex)
     {
         UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Error, ex.Message);
     }
 }